私はちょうど基本的な直感を発展させるために温度に対するレース時間の単純な回帰を実行している。私のデータセットは非常に大きく、各観測は特定のレースのユニットのレース完了時間です。Stataは多次元線形性のために変数を落とさず(回帰で)、私はそうだと思う。
私は、温度ビンに非常に単純なレースタイムを回しています。一時変数の
概要:
|
Variable | Obs Mean Std. Dev Min Max
------------+--------------------------------------------
avg_temp_scc| 8309434 54.3 9.4 0 89
時間変数の概要:
Variable | Obs Mean Std. Dev Min Max
------------+--------------------------------------------
chiptime | 8309434 267.5 59.6 122 1262
私は、温度10度のビンを作成し、それらに対して時間を退行することを決めました。
コードは次のとおり
egen temp_trial = cut(avg_temp_scc), at(0,10,20,30,40,50,60,70,80,90)
reg chiptime i.temp_trial
出力
Source | SS df MS Number of obs = 8309434
---------+------------------------------ F( 8,8309425) =69509.83
Model | 1.8525e+09 8 231557659 Prob > F = 0.0000
Residual | 2.7681e+108309425 3331.29368 R-squared = 0.0627
-----+-------------------------------- Adj R-squared = 0.0627
Total | 2.9534e+108309433 3554.22521 Root MSE = 57.717
chiptime | Coef. Std. Err. t P>|t| [95% Conf. Interval]
----------+----------------------------------------------------------------
temp_trial |
10 | -26.63549 2.673903 -9.96 0.000 -31.87625 -21.39474
20 | 10.23883 1.796236 5.70 0.000 6.71827 13.75939
30 | -16.1049 1.678432 -9.60 0.000 -19.39457 -12.81523
40 | -13.97918 1.675669 -8.34 0.000 -17.26343 -10.69493
50 | -10.18371 1.675546 -6.08 0.000 -13.46772 -6.899695
60 | -.6865365 1.675901 -0.41 0.682 -3.971243 2.59817
70 | 44.42869 1.676883 26.49 0.000 41.14206 47.71532
80 | 23.63064 1.766566 13.38 0.000 20.16824 27.09305
_cons | 273.1366 1.675256 163.04 0.000 269.8531 276.42
正しく温度(この場合は0-10で)ビンのいずれかをドロップだからSTATAです。
今、私は手動でビンを作成して、再度回帰を実行しました:
gen temp0 = 1 if temp_trial==0
replace temp0 = 0 if temp_trial!=0
gen temp1 = 1 if temp_trial == 10
replace temp1 = 0 if temp_trial != 10
gen temp2 = 1 if temp_trial==20
replace temp2 = 0 if temp_trial!=20
gen temp3 = 1 if temp_trial==30
replace temp3 = 0 if temp_trial!=30
gen temp4=1 if temp_trial==40
replace temp4=0 if temp_trial!=40
gen temp5=1 if temp_trial==50
replace temp5=0 if temp_trial!=50
gen temp6=1 if temp_trial==60
replace temp6=0 if temp_trial!=60
gen temp7=1 if temp_trial==70
replace temp7=0 if temp_trial!=70
gen temp8=1 if temp_trial==80
replace temp8=0 if temp_trial!=80
reg chiptime temp0 temp1 temp2 temp3 temp4 temp5 temp6 temp7 temp8
を出力した:ビンを一定に含めているデータセット全体とSTATAを網羅している
Source | SS df MS Number of obs = 8309434
---------+------------------------------ F( 9,8309424) =61786.51
Model | 1.8525e+09 9 205829030 Prob > F = 0.0000
Residual | 2.7681e+108309424 3331.29408 R-squared = 0.0627
--------+------------------------------ Adj R-squared = 0.0627
Total | 2.9534e+108309433 3554.22521 Root MSE = 57.717
--------------------------------------------------------------------------
chiptime | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------+----------------------------------------------------------------
temp0 | -54.13245 6050.204 -0.01 0.993 -11912.32 11804.05
temp1 | -80.76794 6050.204 -0.01 0.989 -11938.95 11777.42
temp2 | -43.89362 6050.203 -0.01 0.994 -11902.08 11814.29
temp3 | -70.23735 6050.203 -0.01 0.991 -11928.42 11787.94
temp4 | -68.11162 6050.203 -0.01 0.991 -11926.29 11790.07
temp5 | -64.31615 6050.203 -0.01 0.992 -11922.5 11793.87
temp6 | -54.81898 6050.203 -0.01 0.993 -11913 11803.36
temp7 | -9.703755 6050.203 -0.00 0.999 -11867.89 11848.48
temp8 | -30.5018 6050.203 -0.01 0.996 -11888.68 11827.68
_cons | 327.269 6050.203 0.05 0.957 -11530.91 12185.45
注意回帰ではなく、容器のどれも落とされていない。これは間違っていませんか?定数が回帰に含まれていることを考えれば、ビンのいずれかを落として「基底ケース」にしてはいけませんか?私はここではっきりと何かを見逃しているように感じます。
編集: ここにデータとドールファイルのドロップボックスリンクがあります: これは考慮中の2つの変数だけを含んでいます。ファイルは129 MBです。私はまたリンクの私の出力の写真を持っています。
この問題のステートメントは、[MVCE](https://stackoverflow.com/help/mcve) –
のメリットがあります。確認するには、確認するために 'assert(temp0 + temp1 + ... + temp8)== 1 '確かにあなたの箱は網羅的です。 –
@WilliamLisowski私はアサートを行い、エラーは発生しませんでした。 MVCEでは、エラーを再現し、これらを投稿に添付するデータセットとファイルを作成する必要がありますか? – user52932