Hi there,
I am running a three-level growth curve with a random slope of age. I'm unsure whether the VPC should contain just the variance around the constant terms at each level, as follows:
display [RP2]var(cons)/([RP3]var(cons) + [RP2]var(cons) + [RP1]var(cons))
But should the random slope at level 2 also be included in calculations of the VPC?
VPC in a three level random slopes model
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: VPC in a three level random slopes model
Hi,
This is more a general multilevel modelling question rather than one specific to runmlwin
Basically the VPC formula is now more complex and is a function of any covariates with random coeficients (here cons and age)
Please see the following article for details
Goldstein, H., Browne, W., & Rasbash, J. (2002). Partitioning variation in multilevel models. Understanding Statistics: Statistical Issues in Psychology, Education, and the Social Sciences, 1, 223-231.
Best wishes
George
This is more a general multilevel modelling question rather than one specific to runmlwin
Basically the VPC formula is now more complex and is a function of any covariates with random coeficients (here cons and age)
Please see the following article for details
Goldstein, H., Browne, W., & Rasbash, J. (2002). Partitioning variation in multilevel models. Understanding Statistics: Statistical Issues in Psychology, Education, and the Social Sciences, 1, 223-231.
Best wishes
George
Re: VPC in a three level random slopes model
Hi George,
Thank you very much for the advice and reference. Is it possible to supply syntax to calculate the VPC with random effects of the constant and age? This is not included in the runmlwin journal article so I'm struggling with how to calculate this.
Many thanks,
Elisabeth
Thank you very much for the advice and reference. Is it possible to supply syntax to calculate the VPC with random effects of the constant and age? This is not included in the runmlwin journal article so I'm struggling with how to calculate this.
Many thanks,
Elisabeth
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: VPC in a three level random slopes model
Hi Elizabeth,
Suppose you fitted a two-level random-slope model to repeated measures data
You would then generate the level-1 and level-2 variance functions as follows
Dividing the level-2 variance function by the total variance function gives the level-2 VPC function
You can then graph the level-2 VPC as a function of time
The extension to three-levels is straight foward. You would simply have three variance functions, one for each level. You can calculate the VPC function at any level by dividing the corresponding variance function by the total variance function.
I hope that helps
George
Suppose you fitted a two-level random-slope model to repeated measures data
Code: Select all
. runmlwin outcome cons time, level2(individual: cons time) level1(occasion: cons)
Code: Select all
. generate l2varfn = [RP2]var(cons) + 2*[RP2]cov(cons\time)*time + [RP2]var(time)*time^2
. generate l1varfn = [RP1]var(cons)
Code: Select all
. generate l2vpc = l2varfn/(l2varfn + l1varfn)
Code: Select all
. line l2vpc time
I hope that helps
George
Re: VPC in a three level random slopes model
Hi George,
Thank you so much for your help, I've done as you suggest and it works perfectly.
Elisabeth
Thank you so much for your help, I've done as you suggest and it works perfectly.
Elisabeth
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: VPC in a three level random slopes model
That's great news, and well done on extending the example from the two-level case to your three-level case
Best wishes
George
Best wishes
George