Page 1 of 1
How do I control for variables in a linear regression?
Posted: Wed Apr 22, 2020 9:53 pm
by samwise
Hi!
I'm trying to do a linear regression while controlling for several variables (gender, age, etc). What's the process for doing that?
Thank you so much!
Re: How do I control for variables in a linear regression?
Posted: Thu Apr 23, 2020 7:09 am
by jonathon
hi,
you just add them in as factors or covariates.
cheers
jonathon
Re: How do I control for variables in a linear regression?
Posted: Thu Apr 23, 2020 2:02 pm
by samwise
Got it, thank you so much!
Re: How do I control for variables in a linear regression?
Posted: Fri Apr 24, 2020 4:15 am
by jonathon
actually sam, what i've said isn't quite correct. you can easily control for continuous variables by including them as a covariate in a linear regression. but if you want to include 'random factors', you'll need to use the 'mixed effects models' in GAMLj. you can read up on the difference between fixed and random factors, and GAMLj will be the ticket.
cheers
jonathon