Hi!
I have a longitudinal analysis with lots of time-varying covariates. I have made both between and within variables of these covariates. This was done like this:
I want to look at, among other things, whether the association between age and depvar depends on noise_bp. Let us further say that I want to see whether depvar differs for different levels of noise_bp at age 3 years. The noise_bp contains information from ages 0 through 8, and thus, the variable contains information from a later age than the age in question (age 3). Is this problematic?
Best,
Kjell Weyde
I have a longitudinal analysis with lots of time-varying covariates. I have made both between and within variables of these covariates. This was done like this:
Code:
*Make within (wp) and between (bp) variables of the variable noise:: egen noise_bp = mean(noise), by(ID) /*This variable now represents the between persons effect, the person mean of noise values*/ *Next, I create a variable that represents the within person effect (each noise score's difference from the person's mean noise value): gen noise_wp = noise - noise_bp
Best,
Kjell Weyde
Comment