1
$\begingroup$

I'm reading this data analysis book by Gelman and Hill and am trying to understand predictions with hierarchical models. On page 273 they are demonstrating making new predictions for an already observed group and state

Still more generally, we can add in the inferential uncertainty in the estimated parameters, α, β, and σ.

I'm trying to understand how one would do that. As an example:

I have a hierarchical regression model as such:

\begin{aligned} & Y = b_{0_j} + b_1 x + \epsilon \\ & b_0 = U + \eta_j \\ \end{aligned}

I fit the model on 5 different groups j1, j2, j3, j4, and j5

The resulting parameters I received are

  • U = 5
  • $\eta_j = [1, 2, -1, 4, -3]$
  • b_1 = 3
  • epsilon is normally distributed with variance 2.25
  • the between group variance is 2.25

I want to make a prediction using this model for a new observation. The new observation is in group 5 and has an x value of 4. I believe I would calculate the point prediction by plugging in values to the above formula that is

\begin{aligned} & b_{0_5} = 5 + (-3) = 2 \\ & Y = 2 + 3(4) = 14 \\ \end{aligned}

My main question is how would I construct a 95% confidence interval around this estimate? I think I might add/subtract 1.96 * std(e) but that doesn't account for the between group variation. On the other hand adding in the between group variation in full seems wrong to me since the intercept for group j5 ($U + \eta_5$) is already far from the mean intercept U.

The book gives examples of sampling from various distributions, but even if you were to sample from distributions, would you sample eta 5 (eg -3) from N(-3, 2.25)? or would you sample U from N(5, 2.25) and then add -3 for eta? Or would you sample b0_5 from N(2, 2.25)?

Additionally, would the method to construct the interval be the same if the model had varying intercept and slope? How about if there were group level predictors?

$\endgroup$
5
  • $\begingroup$ I think what they are getting at here is that you could construct a 95% prediction interval by describing the draws from a simulation of 1000 $\tilde{y}$ based on the model. In terms of incorporating uncertainty from the other parameters, I think the easiest way to do this would be full Bayes, which bakes uncertainty into every parameter. $\endgroup$
    – Erik Ruzek
    Commented Sep 19 at 22:25
  • $\begingroup$ Even if you were to sample from distributions, would you sample eta 5 (eg -3) from N(-3, 2.25)? or would you sample U from N(5, 2.25) and then add -3 for eta? Or would you sample b0_5 from N(2, 2.25)? $\endgroup$
    – RSHAP
    Commented Sep 20 at 12:46
  • 1
    $\begingroup$ It is better to edit the question than to ask in a comment. Probably @ErikRuzek did not see your comment since you did not note him (by using @...) $\endgroup$ Commented Oct 6 at 20:34
  • $\begingroup$ @ErikRuzek thanks for your response! I updated the question with my comment/question about how to sample these values. $\endgroup$
    – RSHAP
    Commented Oct 7 at 21:56
  • $\begingroup$ I am not certain how one would do this without using full Bayes. As a start, you could probably use the variance-covariance matrix of the full fixed and random effects. See stats.stackexchange.com/questions/414864/… $\endgroup$
    – Erik Ruzek
    Commented Oct 9 at 20:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.