Important information for a power analysis:
Everything we have covered so far and will cover (even next semester!) falls under the framework of general linear models.
Data = Model + Error
Predictor variable(s) have non-zero association with outcome variable(s)
No relationships between variables
The lm() function can be used to conduct any analysis that falls under the general linear model framework.
Syntax:
Syntax for correlation assignment from last week:
dta <- read.csv("dawtry-study1a-scored.csv")
corr_model <- lm(Support_for_Redistribution ~ Household_Income, data = dta)What happens when you use the summary() function on corr_model?
What about plot()?
Examples?
##
## t test of coefficients:
##
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.1877e+00 9.7535e-02 42.9357 < 2e-16 ***
## Household_Income -5.2058e-06 1.3776e-06 -3.7791 0.00019 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1