lincom的结果和reg的结果
. lincom weight-length
( 1) weight - length = 0
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 108.8537 38.82367 2.80 0.007 31.31751 186.39
------------------------------------------------------------------------------
.
. gen dx=weight+length
. reg price rep78 dx weight
Source | SS df MS Number of obs = 69
-------------+------------------------------ F( 3, 65) = 16.16
Model | 246375736 3 82125245.5 Prob > F = 0.0000
Residual | 330421222 65 5083403.42 R-squared = 0.4271
-------------+------------------------------ Adj R-squared = 0.4007
Total | 576796959 68 8482308.22 Root MSE = 2254.6
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
rep78 | 844.9462 302.0363 2.80 0.007 241.738 1448.154
dx | -103.6016 37.78457 -2.74 0.008 -179.0626 -28.14063
weight | 108.8537 38.82367 2.80 0.007 31.31751 186.39
_cons | 6850.952 4312.738 1.59 0.117 -1762.181 15464.08
------------------------------------------------------------------------------
- . use auto,clear
- (1978 Automobile Data)
- .
- . reg price rep78 weight length
- Source | SS df MS Number of obs = 69
- -------------+------------------------------ F( 3, 65) = 16.16
- Model | 246375736 3 82125245.5 Prob > F = 0.0000
- Residual | 330421222 65 5083403.42 R-squared = 0.4271
- -------------+------------------------------ Adj R-squared = 0.4007
- Total | 576796959 68 8482308.22 Root MSE = 2254.6
- ------------------------------------------------------------------------------
- price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
- -------------+----------------------------------------------------------------
- rep78 | 844.9462 302.0363 2.80 0.007 241.738 1448.154
- weight | 5.252098 1.103427 4.76 0.000 3.048401 7.455794
- length | -103.6016 37.78457 -2.74 0.008 -179.0626 -28.14063
- _cons | 6850.952 4312.738 1.59 0.117 -1762.181 15464.08
- ------------------------------------------------------------------------------
- . test weight-length=0
- ( 1) weight - length = 0
- F( 1, 65) = 7.86
- Prob > F = 0.0067
- . lincom weight-length
- ( 1) weight - length = 0
- ------------------------------------------------------------------------------
- price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
- -------------+----------------------------------------------------------------
- (1) | 108.8537 38.82367 2.80 0.007 31.31751 186.39
- ------------------------------------------------------------------------------
- .
- . gen dx=weight+length
- . reg price rep78 dx weight
- Source | SS df MS Number of obs = 69
- -------------+------------------------------ F( 3, 65) = 16.16
- Model | 246375736 3 82125245.5 Prob > F = 0.0000
- Residual | 330421222 65 5083403.42 R-squared = 0.4271
- -------------+------------------------------ Adj R-squared = 0.4007
- Total | 576796959 68 8482308.22 Root MSE = 2254.6
- ------------------------------------------------------------------------------
- price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
- -------------+----------------------------------------------------------------
- rep78 | 844.9462 302.0363 2.80 0.007 241.738 1448.154
- dx | -103.6016 37.78457 -2.74 0.008 -179.0626 -28.14063
- weight | 108.8537 38.82367 2.80 0.007 31.31751 186.39
- _cons | 6850.952 4312.738 1.59 0.117 -1762.181 15464.08
- ------------------------------------------------------------------------------