Week 3- r studio notes Flashcards
which code do you use to empty the R environment
rm(list=ls())
what does head(mh) mean
used to display the first n rows present in the input data frame
how would you calculate means and standard deviations for anxiety and engagement
descriptives <- mh %>%
summarise(mean_Abil = mean(Abil, na.rm = TRUE),
sd_Abil = sd(Abil, na.rm = TRUE),
mean_IQ = mean(IQ, na.rm = TRUE),
sd_IQ = sd(IQ, na.rm = TRUE))
how do you build a regression model
mod <- lm(Abil ~ IQ, data = mh)
mod_summary <- summary(mod)
mod_summary
how would you calculate the mean anxiety scores?
descriptives <- stars %>%
group_by(ID) %>%
summarise(mean_Score = mean(Score, na.rm = TRUE),
sd_Score = sd(Score, na.rm = TRUE))
view(descriptives)
how do you join dataframes?
joined <-
stars %>% inner_join(psess)
How to check the assumptions- what does each one mean
crPlots(mod) - to check linearity
qqPlot() to check normality of the residuals
residualPlot() to check homoscedasticity of the residuals