Control variable in multiple regression in R-Studio?

Hello,

Before I ask my question, I need to explain briefly.

I want to use the Allbus2021 data to clarify my hypothesis about whether the approval/opposition of abortion changes depending on the social class of the respondent. My dependent variable is the opinion on abortion, and my independent variable is social class. I've already run a multiple regression in R Studio, and it was (somewhat) successful. However, to determine whether the effect is significant, the instructor suggested I include age as a control variable. But now I'm pretty clueless about how to go about it.

Does anyone here have a tip on how I can add age as a control variable as easily as possible? Perhaps using R commands, that would really help me immensely! <3

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Machma2000
9 months ago

This is then simply an additional predictor. Social layer(s) you certainly have silly-coded, so several predictors are already in the model. Age is just another.

Machma2000
9 months ago
Reply to  vickschnick

You used this as a categorial factor, is that meant? If R can handle this, it’s good. However, I am not aware that R then calculates a variance analysis or actually a regression (so that each stage should be coded with 0=not applicable 1=corresponding stupidy; one step stays completely out, this is the “reference stage”).