Hallo,
i´m sorry for this simple question in a forum like this. But I don’t know what to do next.
I run random effects regression and obtain the overall R-squared. Then I would like to calculate the r-squared manual.
I know the formula for r-squared and this work for usual regress command.
reg y x
predict y_hat
Then i obtain the standard deviation for y and y_hat.
r-squared = SSE / SST = (standard deviation_ y_hat)^2/(standard deviation_y)^2
I get exactly reported r-squared.
But this approach doesn’t work after xtreg / xtregar command. The manual calculated r-squared is always approx.0,01 or 0,02 smaller or higher like reported r2. I know the formula for overall r-squared is corr(xitβ^,yit)2 . But I think xitβ = y_it_hat and I can use the usual r-squared formula r2= SSE/ SST.
I am very grateful for your help.
i´m sorry for this simple question in a forum like this. But I don’t know what to do next.
I run random effects regression and obtain the overall R-squared. Then I would like to calculate the r-squared manual.
I know the formula for r-squared and this work for usual regress command.
reg y x
predict y_hat
Then i obtain the standard deviation for y and y_hat.
r-squared = SSE / SST = (standard deviation_ y_hat)^2/(standard deviation_y)^2
I get exactly reported r-squared.
But this approach doesn’t work after xtreg / xtregar command. The manual calculated r-squared is always approx.0,01 or 0,02 smaller or higher like reported r2. I know the formula for overall r-squared is corr(xitβ^,yit)2 . But I think xitβ = y_it_hat and I can use the usual r-squared formula r2= SSE/ SST.
I am very grateful for your help.
Comment