Hello,
I am trying to obtain standard errors (to be used in calculating 95% CIs) for group-level predicted probabilities generated from a multilevel logistic model. For context, I have individuals at level 1 nested within groups at level 2, and I am using the "xtmelogit" command. I first fit the model and use "predict" to get the level 2 residuals for each group and their standard errors:
I then use "predict" to get the predicted probabilities. Specifically, I am calculating the predicted probability for each group first based on the fixed effects and random effects:
p_total = logit-1(beta0 + beta1(cov1) + beta2(cov2) + u)
And then looking to "decompose" this into the part due to just the fixed effects:
p_fixed = logit-1(beta0 + beta1(cov1) + beta2(cov2))
And obtaining the part due to the random effects through subtraction:
p_random = p_total - p_fixed
I know that predict [newvar] stdp calculates the standard error of the linear prediction; however, is it possible to calculate the standard error for my three predicted values (p_total, p_fixed, and p_random)? Thank you very much!
I am trying to obtain standard errors (to be used in calculating 95% CIs) for group-level predicted probabilities generated from a multilevel logistic model. For context, I have individuals at level 1 nested within groups at level 2, and I am using the "xtmelogit" command. I first fit the model and use "predict" to get the level 2 residuals for each group and their standard errors:
Code:
xtmelogit outcome cov1 cov2 || group:, variance predict u0, reffects predict u0se, reses egen pickone = tag(iig)
p_total = logit-1(beta0 + beta1(cov1) + beta2(cov2) + u)
And then looking to "decompose" this into the part due to just the fixed effects:
p_fixed = logit-1(beta0 + beta1(cov1) + beta2(cov2))
And obtaining the part due to the random effects through subtraction:
p_random = p_total - p_fixed
Code:
predict p_total, mu predict p_fixed, mu fixedonly generate p_random = p_total - p_fixed list group p_total p_fixed p_random if pickone==1
Comment