Hi all,
I found a paper which includes the code for a two part model to calculate the healthcare expenditure. There are some parts of the code that I don't understand. During the post-processing after PROC MIXED, it used x3 x4 x6 to calculate logsigmasq, saying that they are x3 x4 x6 are covariates for variance. What does it mean? Where can I get my x3 x4 x6? Thanks
See below:
proc transpose data=esttheta out=esttheta;
var estimate;
id covparm;
run;
data esttheta;
set esttheta;
exp_intercept=log(residual);
run;
data out2;
if _n_ =1 then set esttheta;
set out1;
logsigmasq=exp_intercept+exp_x3*x3+ exp_x4*x4 +exp_x6*x6;
/* x3 x4 x6 are covariates for variance */
sigmasqcompute=exp(logsigmasq);
/* use below to check that you calculated sigmasqcompute correctly,
It gives you sigma for the positive values used in estimation*/
sigmahat=resid/pearsonresid;
sigmasq=sigmahat**2;/*this should agree with sigmasqcompute */
predposcost=exp(pred+0.5*sigmasqcompute);
run;