This command draws straight or curved lines. It can be used to graph the results of a regression.
. drop if earndad > 10000
(2 observations deleted)
. reg award earndad, r
Regression with robust standard errors Number of obs = 279
F( 1, 277) = 43.07
Prob > F = 0.0000
R-squared = 0.2979
Root MSE = 200.91
------------------------------------------------------------------------------
| Robust
award | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
earndad | .0770272 .0117365 6.56 0.000 .0539231 .1001313
_cons | 265.7285 14.62653 18.17 0.000 236.9352 294.5218
------------------------------------------------------------------------------
. predict award_hat
(option xb assumed; fitted values)
. line award_hat earndad, sort
. gen ed_2 = earndad * earndad
. reg award earndad ed_2, r
Regression with robust standard errors Number of obs = 279
F( 2, 276) = 36.76
Prob > F = 0.0000
R-squared = 0.3042
Root MSE = 200.37
------------------------------------------------------------------------------
| Robust
award | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
earndad | .1015935 .0237884 4.27 0.000 .0547637 .1484233
ed_2 | -4.05e-06 4.66e-06 -0.87 0.386 -.0000132 5.13e-06
_cons | 253.5037 14.97709 16.93 0.000 224.0199 282.9875
------------------------------------------------------------------------------
. predict a_hat
(option xb assumed; fitted values)
. line a_hat earndad, sort
contact: djiboliz@gmail.com
last modified: 17 April 2007