Quiz 1 - Addendum
Classwork 7
Descriptive Statistics
The following provides the percentage of the correct answers for each question in Quiz 1 - Addendum:
Question 1. data.frame
In a data frame, what form does a variable take?
Answer: Column
- This slide in Lecture 7 explains what makes a data.frame tidy. In our course, all given data.frames are tidy.
- It’s been a while since we discussed variable-column, observation-row, and value-cell terminologies in a tidy data.frame, but these concepts are crucial for conducting data analysis.
- In a data.frame:
- A variable takes a column
- An observation takes a row
- A value takes a cell
Question 2. left_join()
<- df_1 |> ___(df_2) df_joined
- Fill in the blank (___) to join the two related data.frames,
df_1
anddf_2
, in a way that keeps all observations and variables in the data.framedf_1
.
Answer: left_join
<- df_1 |> left_join(df_2) df_joined
- This slide in Lecture 14 and this slide in Lecture 12 explain join and
left_join()
.
Question 3. ==
(Equality operator)
<- df |> filter(num __ 9) df_filtered
- Fill in the blank (___) to keep observations, in which the value of the
num
variable is equal to 9.
Answer: ==
<- df |> filter(num == 9) df_filtered
- This slide and many examples from class R scripts explain this equality operator.
Question 4. !=
(Not-equal operator)
<- df |> filter(month ___ 12) non_dec
- Fill in the blank (___) to keep observations, in which the value of the
month
is not equal to 12 in the data.framedf
Answer: !=
<- df |> filter(month != 12) non_dec
- This slide and Line 63-64 in this class R script in Lecture 14 explain a not-equal operator,
!=
(not equal to).
Question 5. |
(Or operator)
<- df |> filter(subject == "DANL" ___ subject == "ECON") df_filtered
- Fill in the blank (___) to keep observations, in which the value of the
subject
variable is either “DANL” or “ECON”
Answer: |
<- df |> filter(subject == "DANL" | subject == "ECON") df_filtered
This slide and this slide in Lecture 14 explain logical operation,
|
(or).Please note that
|
is not the letter “I” or “l,” but a vertical bar character.On a keyboard,
|
is located above the Enter/Return key.
Discussion
Welcome to our Quiz 1 Discussion Board! 👋
This space is designed for you to engage with your classmates about the material covered in Quiz 1.
Whether you are looking to delve deeper into the content, share insights, or have questions about the content, this is the perfect place for you.
If you have any specific questions for Byeong-Hak (@bcdanl) or peer classmate (@GitHub-Username) regarding the Quiz 1 materials or need clarification on any points, don’t hesitate to ask here.
Let’s collaborate and learn from each other!