
Hello! I'm a student working on my senior thesis and I'm currently using R's linear model function to predict voting behavior based on a psychological construct (implicit theories of leadership or ILT's)
My data includes ~500 observations where the participants rated ILT's, reported their demographic information, and who they voted for (or would have wanted to vote for) in 2016. I have demographic information, voting behavior, and political affiliation in dummycode data frame.
My LM model looks like this:
summary(lm(formula = revolushun.calculations$i.iltdim.sensitivity ~ dummy.vote.frame$donald + dummy.vote.frame$ben +dummy.vote.frame$bernie))
This line of code produces results that look like this:
Call:
lm(formula = revolushun.calculations$i.iltdim.sensitivity ~ dummy.vote.frame$donald +
dummy.vote.frame$ben + dummy.vote.frame$bernie)
Residuals:
Min 1Q Median 3Q Max
6.6318 0.7464 0.5870 1.0348 1.8810
Coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 9.0797 0.1063 85.410 < 2e16 ***
dummy.vote.frame$donald 0.6214 0.3458 1.797 0.07293 .
dummy.vote.frame$ben 0.9607 0.3227 2.977 0.00304 **
dummy.vote.frame$bernie 0.4479 0.1449 3.091 0.00210 **

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.612 on 546 degrees of freedom
Multiple Rsquared: 0.02824, Adjusted Rsquared: 0.0229
Fstatistic: 5.289 on 3 and 546 DF, pvalue: 0.001335
I believe this is doing what I needed it to, but is there a way to alter the command so that R will run the linear model and control for gender?
