Page 1 of 1

10. Use the following code to create a new data set 2 mark ` select(id, starts_with("side"), starts_with("pie"), starts_

Posted: Fri May 20, 2022 11:41 am
by answerhappygod
10. Use the following code to create a new data set 2 mark
` select(id, starts_with("side"), starts_with("pie"),
starts_with("dessert")) %>% select(-side15, -pie13, -dessert12)
%>% gather(type, value, -id) %>% filter(!is.na(value), !value
%in% c("None", "Other (please specify)")) %>% mutate(type =
str_remove(type, "\\d+")) `
Write 2-3 sentences with your explanation of what it does.
11-12. Install package `widyr` and use `pairwise_cor()`
function
Write 2-3 sentences with your explanation of what it does.
Use this code for the new dataset ` pairwise_cor(value, id,
sort = TRUE) ` Write 1 sentence with your explanation of what
insights it shows.
13. Use `lm()` or randomForest() function to build a model that
predict a family income based on data in the dataset.
Compare 3 models using different set of input variables. Use
different number of variables.
Explain your choice of variables (3 sentences)
Write 2 sentences explaining which model is best.