是因为你的变量通过复制或excel导入的,没有定义数据类型.这时回归
reg y x
no observations
r(2000);
只需要执行以下命令,就ok了!看下面的操作
. destring y,replace
y has all characters numeric; replaced as double
. destring x,replace
x has all characters numeric; replaced as double
. regress y x
Source | SS df MS Number of obs = 31
-------------+------------------------------ F( 1, 29) = 69.65
Model | 19324930.8 1 19324930.8 Prob > F = 0.0000
Residual | 8046596.27 29 277468.837 R-squared = 0.7060
-------------+------------------------------ Adj R-squared = 0.6959
Total | 27371527.1 30 912384.236 Root MSE = 526.75
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0707288 .0084751 8.35 0.000 .0533953 .0880623
_cons | 52.13778 152.9305 0.34 0.736 -260.6402 364.9157
------------------------------------------------------------------------------
.