Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Prediction interval for a single observation

    Hello, I'm working with a simple linear regression. And I am regressing one dependent varible on one independent variable, both have numeric type. Sample size = 50.

    Code:
    reg y x
    Now, I can create a predicted values from estimated regression, but I'd also like to calculate a prediction interval for a single observation (let's say I am interested only in 5th observation in my dataset).

    Can you help me? Thank you very much in advance.
    Last edited by Karel Novak; 29 Apr 2024, 13:40.

  • #2
    it is not at all clear why you want an interval for just one observation, nor how that observation was chosen; however, I suggest that the place to start is with the -predict- command and the standard error of the linear prediction (stdp in Stata terms); see
    Code:
    help regress postestimation##predict

    Comment


    • #3
      Thank you. I didn't mention this kind of information since I presume it to be redundant in context of the problem. Anyway, the raison d'être is to compare cases (Y) given their input context (X), which may be quite different among study cases. My goal is (to be able) to say: "Look, this concrete case A may be well above average in a naïve absolute comparasion to other cases, but given the very unequal conditions, it is not fair to compare without context X."

      Now, I am particulary intrested in this case A, so I want to predict it's outcome Y given X. Since the prediction has some uncertainty on its own, I wanted to add this information as well (wouldn't like to present just the point estimate).

      So, I think the -stdp- just do the job, and to create 95% CI I will multiply the S.E. by 1,96.
      Last edited by Karel Novak; 30 Apr 2024, 00:00.

      Comment

      Working...
      X