constraints in joint model
Posted: Thu Nov 22, 2012 11:45 am
Hello,
We're trying to run a joint model with two response variables. For one response, we need to fix some of the covariances between level 2 random effects to zero. In mlwin, this model runs fine and everything looks nice.
In runmlwin, I can't get it to set the covariances to zero. I tried the same syntax as I would use in a single response model, i.e.:
matrix a = (1,1,1,0,0,1)
sort id num
runmlwin (kcal cons s1_07 s1_7_max source childcomp evalid2 evalid3 ///
male males1_07 males1_7_max, eq(1)) (bmi cons , eq(2)), ///
level2(id: (cons s1_07 s1_7_max, eq(1) reset(none)) (cons , reset(none) eq(2)) ) level1(seq: (cons agewk source, reset(none) elements(a) eq(1)))
It completely ignored this and estimated all terms of the covariance matrix.
So I tried using constraints:
constraint define 1 [RP1]cov(cons_1\source_1) = 0
constraint define 2 [RP1]cov(source_1\agewk_1) = 0
sort id num
runmlwin (kcal cons s1_07 s1_7_max source childcomp evalid2 evalid3 ///
male males1_07 males1_7_max, eq(1)) (bmi cons , eq(2)), ///
level2(id: (cons s1_07 s1_7_max, eq(1) reset(none)) (cons , reset(none) eq(2)) ) level1(seq: (cons agewk source, reset(none) eq(1))) constraints(1/2) maxiter(100)
In this model, the covariances were NEARLY zero, but not quite! And having them estimated causes problems, as the model cannot then estimate the variance of the level 1 random effect for one term (source).
Any ideas on how to fix these covariances to zero?
Many thanks,
Laura
We're trying to run a joint model with two response variables. For one response, we need to fix some of the covariances between level 2 random effects to zero. In mlwin, this model runs fine and everything looks nice.
In runmlwin, I can't get it to set the covariances to zero. I tried the same syntax as I would use in a single response model, i.e.:
matrix a = (1,1,1,0,0,1)
sort id num
runmlwin (kcal cons s1_07 s1_7_max source childcomp evalid2 evalid3 ///
male males1_07 males1_7_max, eq(1)) (bmi cons , eq(2)), ///
level2(id: (cons s1_07 s1_7_max, eq(1) reset(none)) (cons , reset(none) eq(2)) ) level1(seq: (cons agewk source, reset(none) elements(a) eq(1)))
It completely ignored this and estimated all terms of the covariance matrix.
So I tried using constraints:
constraint define 1 [RP1]cov(cons_1\source_1) = 0
constraint define 2 [RP1]cov(source_1\agewk_1) = 0
sort id num
runmlwin (kcal cons s1_07 s1_7_max source childcomp evalid2 evalid3 ///
male males1_07 males1_7_max, eq(1)) (bmi cons , eq(2)), ///
level2(id: (cons s1_07 s1_7_max, eq(1) reset(none)) (cons , reset(none) eq(2)) ) level1(seq: (cons agewk source, reset(none) eq(1))) constraints(1/2) maxiter(100)
In this model, the covariances were NEARLY zero, but not quite! And having them estimated causes problems, as the model cannot then estimate the variance of the level 1 random effect for one term (source).
Any ideas on how to fix these covariances to zero?
Many thanks,
Laura