ST 308 QUIZ 3 QUESTIONS & VERIFIED ANSWERS
What function from dplyr will create new variable(s) and append it (them) to the data
frame used to create it.
In your answer, simply put the name of the function and nothing else. For instance, if
the function were data.frame(x = , ...) you would just write data.frame
mutate()
What does the mutate function from the dplyr package do?
a.
the function adds a column (or columns) to a newly created variable to the current data
frame (or tibble)
b.
the function creates a data frame (or tibble) with just the new column (or columns)
created
c.
the function replaces the values of one of the columns (or columns) of a data frame (or
tibble) and returns only that new column (or columns)
d.
the function replaces the values of one of the columns (or columns) of a data frame (or
tibble)
a.
the function adds a column (or columns) to a newly created variable to the current data
frame (or tibble)
Which package has functions that can be used to take long data and make it wider and
vice versa?
a.
reshape
b.
tidyr
c.
switch
d.
purrr
e.
dplyr
b.
tidyr
,What is the purpose of creating a contingency table?
Select one:
a.
to show the correlation between two continuous variables
b.
to evaluate the effect of a treatment by comparing treated subjects with a control group
c.
to making a decision between rejecting or not rejecting a null hypothesis
d.
to summarize the relationship between one or more categorical variables
d.
to summarize the relationship between one or more categorical variables
What R function did we look at that gives many common sample quantiles and the
mean? Just write the function with or without ().
summary()
Which of the following are most likely categorical variables?
Select one or more:
a.
Marital status
b.
Favorite type of pet
c.
Number of bathrooms
d.
Years of experience
e.
Zip code
f.
Age
a.
Marital status
b.
Favorite type of pet
e.
Zip code
, What features of a quantitative variable do we typically want to summarize?
Select one or more:
a.
spread
b.
center
c. number of categories
d.
frequency of a single value
a.
spread
b.
center
Check all that apply. Which of the following would likely be categorical variables?
a. Favorite website
b. Zip code
c. Hours watching TV in a day
d. Number of children
Favorite Website
Zip code
What does a contingency table display?
a. total sum of the values of a variable or variable(s) in a category or combination of
categories
b. counts of observations falling into a category or combination of categories
c. histograms of observations falling into a category or combination of categories
d. means of each variable within falling into a category or combination of categories
b. counts of observations falling into a category or combination of categories
What type of object does the table() function return?
What function from dplyr will create new variable(s) and append it (them) to the data
frame used to create it.
In your answer, simply put the name of the function and nothing else. For instance, if
the function were data.frame(x = , ...) you would just write data.frame
mutate()
What does the mutate function from the dplyr package do?
a.
the function adds a column (or columns) to a newly created variable to the current data
frame (or tibble)
b.
the function creates a data frame (or tibble) with just the new column (or columns)
created
c.
the function replaces the values of one of the columns (or columns) of a data frame (or
tibble) and returns only that new column (or columns)
d.
the function replaces the values of one of the columns (or columns) of a data frame (or
tibble)
a.
the function adds a column (or columns) to a newly created variable to the current data
frame (or tibble)
Which package has functions that can be used to take long data and make it wider and
vice versa?
a.
reshape
b.
tidyr
c.
switch
d.
purrr
e.
dplyr
b.
tidyr
,What is the purpose of creating a contingency table?
Select one:
a.
to show the correlation between two continuous variables
b.
to evaluate the effect of a treatment by comparing treated subjects with a control group
c.
to making a decision between rejecting or not rejecting a null hypothesis
d.
to summarize the relationship between one or more categorical variables
d.
to summarize the relationship between one or more categorical variables
What R function did we look at that gives many common sample quantiles and the
mean? Just write the function with or without ().
summary()
Which of the following are most likely categorical variables?
Select one or more:
a.
Marital status
b.
Favorite type of pet
c.
Number of bathrooms
d.
Years of experience
e.
Zip code
f.
Age
a.
Marital status
b.
Favorite type of pet
e.
Zip code
, What features of a quantitative variable do we typically want to summarize?
Select one or more:
a.
spread
b.
center
c. number of categories
d.
frequency of a single value
a.
spread
b.
center
Check all that apply. Which of the following would likely be categorical variables?
a. Favorite website
b. Zip code
c. Hours watching TV in a day
d. Number of children
Favorite Website
Zip code
What does a contingency table display?
a. total sum of the values of a variable or variable(s) in a category or combination of
categories
b. counts of observations falling into a category or combination of categories
c. histograms of observations falling into a category or combination of categories
d. means of each variable within falling into a category or combination of categories
b. counts of observations falling into a category or combination of categories
What type of object does the table() function return?