Hi there,
I am trying to obtain predictions from generalise linear regression to multiply imputed data.
I found the codes in 'family(gamma) link(log) ' works
but in 'family(gaussian) link(log)' not works
could i ask about the reason and how to deal with it, thank you
here are the codes:
///////////////////////////////////////////////////////////////////////////////////////////////
*Calculate the predict mean cost of part0*
mi estimate, dots post: glm Total_public_costs_w26 i.Treatment_success_w16 i.Treatment_success_w26 i.Treatment age i.Gender i.site_num i.ethnicity_BAME i.Baseline_HDRS17_Severe if Treatment_path_w16_26==0, family(gamma) link(log)
*combine then predict method*
*first derivatives of prediction equation*
matrix s=2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
matrix list e(b)
*prediction*
matrix phat= s*e(b)'
matrix list phat
*calculate the variance of the prediction*
matrix phat_var= s*e(V)*s'
matrix list phat
*SE of prediction*
di sqrt(phat_var[1,1])
///////////////////////////////////////////////////////////////////////////////////////////////
*Calculate the predict mean cost of part1'*
mi estimate, dots post: glm Total_public_costs_w26 i.Treatment_success_w16 i.Treatment_success_w26 i.Treatment age i.Gender i.site_num i.ethnicity_BAME i.Baseline_HDRS17_Severe if Treatment_path_w16_26==1, family(gaussian) link(log)
*combine then predict method*
*first derivatives of prediction equation*
matrix s=2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
matrix list e(b)
*prediction* ?
matrix phat= s*e(b)' (from this code not works)
matrix list phat
*calculate the variance of the prediction*
matrix phat_var= s*e(V)*s'
matrix list phat
*SE of prediction*
di sqrt(phat_var[1,1])
I am trying to obtain predictions from generalise linear regression to multiply imputed data.
I found the codes in 'family(gamma) link(log) ' works
but in 'family(gaussian) link(log)' not works
could i ask about the reason and how to deal with it, thank you
here are the codes:
///////////////////////////////////////////////////////////////////////////////////////////////
*Calculate the predict mean cost of part0*
mi estimate, dots post: glm Total_public_costs_w26 i.Treatment_success_w16 i.Treatment_success_w26 i.Treatment age i.Gender i.site_num i.ethnicity_BAME i.Baseline_HDRS17_Severe if Treatment_path_w16_26==0, family(gamma) link(log)
*combine then predict method*
*first derivatives of prediction equation*
matrix s=2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
matrix list e(b)
*prediction*
matrix phat= s*e(b)'
matrix list phat
*calculate the variance of the prediction*
matrix phat_var= s*e(V)*s'
matrix list phat
*SE of prediction*
di sqrt(phat_var[1,1])
///////////////////////////////////////////////////////////////////////////////////////////////
*Calculate the predict mean cost of part1'*
mi estimate, dots post: glm Total_public_costs_w26 i.Treatment_success_w16 i.Treatment_success_w26 i.Treatment age i.Gender i.site_num i.ethnicity_BAME i.Baseline_HDRS17_Severe if Treatment_path_w16_26==1, family(gaussian) link(log)
*combine then predict method*
*first derivatives of prediction equation*
matrix s=2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
matrix list e(b)
*prediction* ?
matrix phat= s*e(b)' (from this code not works)
matrix list phat
*calculate the variance of the prediction*
matrix phat_var= s*e(V)*s'
matrix list phat
*SE of prediction*
di sqrt(phat_var[1,1])
Comment