Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Must use tidyverse to answer functional programming questions Please answer all parts correctly in order to get thumbs up :D '{r, message = FALSE}
Must use tidyverse to answer functional programming questions
Please answer all parts correctly in order to get thumbs up :D
" '{r, message = FALSE} library(tidyverse) (a) Complete the following so that the result is a list of three elements. Each element contains 10 random normal r.v.'s with the corresponding means. "''{r} C(-0.3, 0, 0.3) %>% map() (b) Use the map_dbl' function to compute the ordinary mean (i.e, 0% trimmed mean), 10% and 20% trimmed means. ""'{r} X % map_dbl) (c) The following code simulates the performance of a t-test for non-normal data. Could you extract the $p$-value of each test and plot a histogram out of them? trials % modify_if (e) Double all the odd numbers in the following vector using modify_if. ***{r} C(1, 3, 2, 5, 3, 6, 8) %>% modify_ifo (f) Consider the 'mtcars dataset. Group by the variable am, run the linear regression model mpg' vs wt for each group and collect the coefficients of the models as a list. (9) Using the result in (f), predict the average 'mpgfor both auto and manual tranmission car with "wt = 3.2. (h) Which one of the following models resembles the approach in (f)? Explain. **{r} fit1 % map() (b) Use the map_dbl' function to compute the ordinary mean (i.e, 0% trimmed mean), 10% and 20% trimmed means. ""'{r} X % map_dbl) (c) The following code simulates the performance of a t-test for non-normal data. Could you extract the $p$-value of each test and plot a histogram out of them? trials % modify_if (e) Double all the odd numbers in the following vector using modify_if. ***{r} C(1, 3, 2, 5, 3, 6, 8) %>% modify_ifo (f) Consider the 'mtcars dataset. Group by the variable am, run the linear regression model mpg' vs wt for each group and collect the coefficients of the models as a list. (9) Using the result in (f), predict the average 'mpgfor both auto and manual tranmission car with "wt = 3.2. (h) Which one of the following models resembles the approach in (f)? Explain. **{r} fit1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started