Dear Statalist,
*this is my first post, I hope I haven't gotten it all wrong
I am estimating growth curve models for career mobility in the first 5 years from employment begin, with monthly data.The individuals come from 3 different cohorts. I am doing a -mixed- regression with two splines (for years 1-2 and for years 3-5) with random coefficient for each of them. Additionally, I let the estimates differ for each cohort.
I would like to plot the between individual variance using the -twoway function- for different cohorts. It is easy for the first spline, but I don't know how to get an appropriate representation of variance in the second spline. Particularly, what should I do with the covariance between two slope parameters?
My regression command is:
Code:
mixed ses gdp_grate_c ue_youth_c coh1 coh2 coh3 coh1xyear12 coh1xyear35 coh2xyear12 /*
*/ coh2xyear35 coh3xyear12 coh3xyear35 female if workexp<61 & workexp_total>1, nocons/*
*/ || idno: coh1 coh1xyear12 coh1xyear35, nocons cov(uns) /*
*/ || idno: coh2 coh2xyear12 coh2xyear35, nocons cov(uns) /*
*/ || idno: coh3 coh3xyear12 coh3xyear35, cov(uns) nocons
My regression output is:

Mixed-effects ML regression Number of obs = 12,972
Group variable: idno Number of groups = 318

Obs per group:
min = 2
avg = 40.8
max = 60

Wald chi2(12) = 4063.92
Log likelihood = -37702.959 Prob > chi2 = 0.0000

-----------------------------------------------------------------------------------
ses | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------+----------------------------------------------------------------
gdp_grate_centred | .1659419 .0378004 4.39 0.000 .0918545 .2400294
ue_youth_centred | -.1041906 .0186379 -5.59 0.000 -.1407202 -.0676609
coh1 | 53.00175 2.715784 19.52 0.000 47.67891 58.32459
coh2 | 53.70437 2.064054 26.02 0.000 49.6589 57.74984
coh3 | 47.53838 1.575299 30.18 0.000 44.45085 50.62591
coh1xyear12 | .2759483 .0896621 3.08 0.002 .1002138 .4516828
coh1xyear35 | .0258353 .0249494 1.04 0.300 -.0230647 .0747353
coh2xyear12 | -.0264853 .0399533 -0.66 0.507 -.1047923 .0518218
coh2xyear35 | .0359928 .0602369 0.60 0.550 -.0820693 .1540549
coh3xyear12 | .1430991 .0444667 3.22 0.001 .055946 .2302522
coh3xyear35 | .0604466 .0345191 1.75 0.080 -.0072095 .1281028
female | -3.707658 1.659068 -2.23 0.025 -6.959372 -.4559445
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
idno: Unstructured |
var(coh1) | 238.9691 53.61967 153.9395 370.9656
var(coh1x~12) | .3075782 .0751507 .1905378 .4965122
var(coh1x~35) | .0177453 .0050202 .0101924 .0308951
cov(coh1,coh1x~12) | -6.057224 1.726561 -9.441221 -2.673228
cov(coh1,coh1x~35) | -.5503095 .4253194 -1.38392 .2833012
cov(coh1x~12,coh1x~35) | .0236498 .0152105 -.0061623 .0534619
-----------------------------+------------------------------------------------
idno: Unstructured |
var(coh2) | 261.2132 41.69639 191.0386 357.165
var(coh2x~12) | .1088668 .0198047 .0762163 .1555045
var(coh2x~35) | .2486952 .0653707 .1485679 .4163031
cov(coh2,coh2x~12) | -1.7547 .6652563 -3.058578 -.4508214
cov(coh2,coh2x~35) | -3.770098 1.089663 -5.905799 -1.634398
cov(coh2x~12,coh2x~35) | .0431362 .0235373 -.0029961 .0892685
-----------------------------+------------------------------------------------
idno: Unstructured |
var(coh3) | 289.7508 29.51318 237.3142 353.7737
var(coh3x~12) | .3454136 .0375684 .2790999 .4274833
var(coh3x~35) | .113588 .0243943 .0745636 .1730364
cov(coh3,coh3x~12) | -3.932954 .8096228 -5.519786 -2.346123
cov(coh3,coh3x~35) | -.9566461 .5797703 -2.092975 .1796827
cov(coh3x~12,coh3x~35) | -.0500834 .0208554 -.0909592 -.0092076
-----------------------------+------------------------------------------------
var(Residual) | 14.831 .1916211 14.46015 15.21137
------------------------------------------------------------------------------

I have tried following commands (for the first cohort):
Code:
twoway function 238.9691 + 2*(-6.057224)*x + .3075782*x^2, range(0 24) lc(black) || function (238.9691 + 2*(-6.057224)*24 + .3075782*24^2) + 2*(-.5503095)*x + .0177453*x^2, range(24 60) lc(red)

twoway function 238.9691 + 2*(-6.057224)*x + .3075782*x^2, range(0 24) lc(black) || function (238.9691 + 2*(-6.057224)*24 + .3075782*24^2) + 2*(.0236498)*x + .0177453*x^2, range(24 60) lc(red)
I honestly don't think either of these approaches is correct. As said before, I do not know what to do with the covariance parameter for the two slopes. Any help is most welcome!

Katarzyna