Week 3- r studio notes Flashcards

1
Q

which code do you use to empty the R environment

A

rm(list=ls())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does head(mh) mean

A

used to display the first n rows present in the input data frame

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how would you calculate means and standard deviations for anxiety and engagement

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how do you build a regression model

A

mod <- lm(Abil ~ IQ, data = mh)
mod_summary <- summary(mod)
mod_summary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how would you calculate the mean anxiety scores?

A

descriptives <- stars %>%
group_by(ID) %>%
summarise(mean_Score = mean(Score, na.rm = TRUE),
sd_Score = sd(Score, na.rm = TRUE))
view(descriptives)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how do you join dataframes?

A

joined <-
stars %>% inner_join(psess)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to check the assumptions- what does each one mean

A

crPlots(mod) - to check linearity
qqPlot() to check normality of the residuals
residualPlot() to check homoscedasticity of the residuals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly