nulldata 100 genr u = 3*normal() genr x = uniform() genr y = 10 + 10*x + u ols y 0 x ols y x genr yh = $yhat genr R2 = corr(y,yh)^2