Question: data = algae chemical variables = Chla, mnO2, Cl what code would do this? ANSWER TO C: algae.mean = algae.mean = algae %>% mutate_if(is.double, funs(ifelse(is.na(.),

data = algae chemical variables = Chla, mnO2, Cl what code woulddata = algae

chemical variables = Chla, mnO2, Cl

what code would do this?

ANSWER TO C: algae.mean = algae.mean = algae %>% mutate_if(is.double, funs(ifelse(is.na(.), mean(., na.rm=T), .)))

Imputing unknowns with measures of central tendency: the simplest and fastest way of filling in (imputing) missing values is to use some measures of central tendency such as mean median and mode Use mutate_if ) and ifelse ) in dplyr to fill in missing values for each chemical with its mean, and save the imputed dataset as algae.mean. Report the number of observations in algae.mean Display the values of each chemical for the 70th, 117th and 180th obsevation in algae.mean. This simple strategy, although extremely fast and thus appealing for large datasets, imputed values may have large bias that can influence our model fitting. An alternative for decreasing bias of imputed values is to use relationships between variables Imputing unknowns using correlations: another way to impute missing values is to use correlation with another variable. For a highly correlated pair of variables, we can fill in the unknown values by predicting one based on the other with a simple linear regression model, provided the two variables are not both unknown. Compute pairwise correlation between all variables Then, fill in all the missing values in Chla based on mxPH. What are the values you obtain? Hint: use lm) and coef ) function Imputing unknowns with measures of central tendency: the simplest and fastest way of filling in (imputing) missing values is to use some measures of central tendency such as mean median and mode Use mutate_if ) and ifelse ) in dplyr to fill in missing values for each chemical with its mean, and save the imputed dataset as algae.mean. Report the number of observations in algae.mean Display the values of each chemical for the 70th, 117th and 180th obsevation in algae.mean. This simple strategy, although extremely fast and thus appealing for large datasets, imputed values may have large bias that can influence our model fitting. An alternative for decreasing bias of imputed values is to use relationships between variables Imputing unknowns using correlations: another way to impute missing values is to use correlation with another variable. For a highly correlated pair of variables, we can fill in the unknown values by predicting one based on the other with a simple linear regression model, provided the two variables are not both unknown. Compute pairwise correlation between all variables Then, fill in all the missing values in Chla based on mxPH. What are the values you obtain? Hint: use lm) and coef ) function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!