ST 308 QUIZ 3 QUESTIONS & VERIFIED ANSWERS
What is the purpose of the mutate() function from dplyr? - Answers - To add newly
created variables to an already existing tibble
Which function below allows us to instruct R to create summaries of our data by
subgroups? - Answers - group_by()
What is the correct output for the code below?
if_else(30>20, 1, 10) - Answers - 1
What is meant by long format data? - Answers - Long format data is data where each
row represents one observation on a unit.
Which package from the tidyverse do the pivot, wider(), longer() functions come from? -
Answers - tidyr
What is the purpose of the separate() function? - Answers - functionality for splitting up
a column of a tibble!
separate() and _____ are complementary functions. That is, they do the opposite
operations. - Answers - unite()
Which of the following would likely be categorical variables?
Favorite website
Zip Code
Hours watching tv in a day
Number of children - Answers - Favorite website
Zip Code
What type of object does the table() function return? - Answers - array
created a contingency table using the following code:
table(titanicData$sex, titanicData$embarked, titanicData$survived)
The levels for each variable are ordered as follows:
- sex (female, male)
- embarked (C, Q, S)
- survived(0, 1)
How do you access the Sex by Survived two-way table for those that embarked at the
"S" port? - Answers - tab[ , 3 , ]
What aspects of a numeric variable's distribution do we generally try to describe with
numbers? - Answers - Center and Spread
What is the purpose of the mutate() function from dplyr? - Answers - To add newly
created variables to an already existing tibble
Which function below allows us to instruct R to create summaries of our data by
subgroups? - Answers - group_by()
What is the correct output for the code below?
if_else(30>20, 1, 10) - Answers - 1
What is meant by long format data? - Answers - Long format data is data where each
row represents one observation on a unit.
Which package from the tidyverse do the pivot, wider(), longer() functions come from? -
Answers - tidyr
What is the purpose of the separate() function? - Answers - functionality for splitting up
a column of a tibble!
separate() and _____ are complementary functions. That is, they do the opposite
operations. - Answers - unite()
Which of the following would likely be categorical variables?
Favorite website
Zip Code
Hours watching tv in a day
Number of children - Answers - Favorite website
Zip Code
What type of object does the table() function return? - Answers - array
created a contingency table using the following code:
table(titanicData$sex, titanicData$embarked, titanicData$survived)
The levels for each variable are ordered as follows:
- sex (female, male)
- embarked (C, Q, S)
- survived(0, 1)
How do you access the Sex by Survived two-way table for those that embarked at the
"S" port? - Answers - tab[ , 3 , ]
What aspects of a numeric variable's distribution do we generally try to describe with
numbers? - Answers - Center and Spread