mean centering & variables scaling
-
- Posts: 1
- Joined: Tue Mar 19, 2024 2:24 am
mean centering & variables scaling
hello. I am planning to use a mixed model when writing my paper. I have three questions:
1. When controlling covariates such as age, years of education, and gender, it is said that gender is treated as a dummy variable because it is nominal. What about age or years of education? Can I check centered?
2. When the level 2 independent variable is a group, mean centering cannot be performed, so can it be treated as a dummy variable in this case as well?
3. When I want to add covariates, is it correct to put the nominal variables in factors and the rest in covariates?
thank you for your help
have a good day.
1. When controlling covariates such as age, years of education, and gender, it is said that gender is treated as a dummy variable because it is nominal. What about age or years of education? Can I check centered?
2. When the level 2 independent variable is a group, mean centering cannot be performed, so can it be treated as a dummy variable in this case as well?
3. When I want to add covariates, is it correct to put the nominal variables in factors and the rest in covariates?
thank you for your help
have a good day.
- mcfanda@gmail.com
- Posts: 524
- Joined: Thu Mar 23, 2017 9:24 pm
Re: mean centering & variables scaling
1. sure, that is the default. With mixed model is always a good idea to center the covariates (although not necessary)
2. any factor is transformed in contrast variables and their coding is mean-centered (if do not select "dummy" as a coding system)
3. yes
2. any factor is transformed in contrast variables and their coding is mean-centered (if do not select "dummy" as a coding system)
3. yes
- ertugruluyar
- Posts: 8
- Joined: Thu Sep 19, 2024 7:23 am
- Location: Konya, Turkey
- Contact:
Re: mean centering & variables scaling
Hi, I have this variable with coding "simple" and I am doing linear mixed model analysis, this variable is mean-centered now? If I change it to "dummy", does the result of my analysis change?mcfanda@gmail.com wrote: ↑Mon Apr 08, 2024 3:17 pm 1. sure, that is the default. With mixed model is always a good idea to center the covariates (although not necessary)
2. any factor is transformed in contrast variables and their coding is mean-centered (if do not select "dummy" as a coding system)
3. yes
- ertugruluyar
- Posts: 8
- Joined: Thu Sep 19, 2024 7:23 am
- Location: Konya, Turkey
- Contact:
Re: mean centering & variables scaling
I am confused right now and I didn't quite get this explanation:
https://gamlj.github.io/mixed.html#factors-coding
https://gamlj.github.io/mixed.html#factors-coding
- mcfanda@gmail.com
- Posts: 524
- Joined: Thu Mar 23, 2017 9:24 pm
Re: mean centering & variables scaling
Yes, that' correct output.
- mcfanda@gmail.com
- Posts: 524
- Joined: Thu Mar 23, 2017 9:24 pm
Re: mean centering & variables scaling
Please have a look here https://gamlj.github.io/book/glm.html#anova, and here https://gamlj.github.io/rosetta_contrasts.html
- ertugruluyar
- Posts: 8
- Joined: Thu Sep 19, 2024 7:23 am
- Location: Konya, Turkey
- Contact:
Re: mean centering & variables scaling
Thank you so much, I get a bit more now.mcfanda@gmail.com wrote: ↑Fri Sep 27, 2024 9:00 am Please have a look here https://gamlj.github.io/book/glm.html#anova, and here https://gamlj.github.io/rosetta_contrasts.html
For other than the interactions, simple and dummy doing the same thing because "centering around zero = no centering".
But, when doing interactions, (1) if "simple" coding is used for variable called A (and let say the other variable is "B"), in A*B interaction effect:
B's effect on A (meaning B's indirect effect on dependant variable) is calculated using the mean of the B.the mean of the B
(2) if "dummy" coding is used for variable called A (and let say the other variable is "B"), in A*B interaction effect:
B's effect on A (meaning B's indirect effect on dependant variable) is calculated using reference contrast variable (reference dummy variable/ the first one for GAMLj3) of the B.
Am I thinking correctly?
But I couldn't guessing/forecasting that how can I interpret this two situation.
And, also, thank you for the book. Actually, I was found that book but It slipped my mind.
- mcfanda@gmail.com
- Posts: 524
- Joined: Thu Mar 23, 2017 9:24 pm
- ertugruluyar
- Posts: 8
- Joined: Thu Sep 19, 2024 7:23 am
- Location: Konya, Turkey
- Contact:
Re: mean centering & variables scaling
Thank you again and again, have a great day.