I'm running the following regression: Y = β0 + β1Χ1 + β2Χ2 + .. +.βnXn + ε.
What's the easiest way to calculate Y_hat = b0 + b1Χ1 + b2Χ2_bar + .. +.bnXn_bar
where the bs are estimates of βs, and Xi_bar is the mean of Xi?
I did it by storing the means of Xis as scalar and going the longhand way but my code looks kludgy. I was wondering if there is a simpler, cleaner way to do it.
What's the easiest way to calculate Y_hat = b0 + b1Χ1 + b2Χ2_bar + .. +.bnXn_bar
where the bs are estimates of βs, and Xi_bar is the mean of Xi?
I did it by storing the means of Xis as scalar and going the longhand way but my code looks kludgy. I was wondering if there is a simpler, cleaner way to do it.
Comment