stata里php代码,stata命令求解惑
clear
set seed 123456789
set obs 1000
gen x = 5*invnorm(uniform())
gen u =? ?invnorm(uniform())
gen y = 1 + x + u
gen d=y>x
table d
gen d1=d
gen d2=1-d1
gen x1=d1*x
gen x2=d2*x
reg??y x1 x2
隨便模擬的數據,程序結果如下
. clear
. set seed 123456789
. set obs 1000
obs was 0, now 1000
. gen x = 5*invnorm(uniform())
. gen u =? ?invnorm(uniform())
. gen y = 1 + x + u
. gen d=y>x
. table d
----------------------
d |? ?? ?Freq.
----------+-----------
0 |? ?? ???156
1 |? ?? ???844
----------------------
.
. gen d1=d
. gen d2=1-d1
.
. gen x1=d1*x
. gen x2=d2*x
.
. reg??y x1 x2
Source |? ?? ? SS? ?? ? df? ?? ? MS? ?? ?? ?? ???Number of obs =? ? 1000
-------------+------------------------------? ?? ?? ???F(??2,? ?997) =12762.53
Model |??25150.5031? ???2??12575.2516? ?? ?? ???Prob > F? ?? ?=??0.0000
Residual |??982.369613? ?997? ?.98532559? ?? ?? ???R-squared? ???=??0.9624
-------------+------------------------------? ?? ?? ???Adj R-squared =??0.9623
Total |??26132.8727? ?999??26.1590318? ?? ?? ???Root MSE? ?? ?=??.99264
------------------------------------------------------------------------------
y |? ?? ?Coef.? ?Std. Err.? ?? ?t? ? P>|t|? ???[95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 |? ?.9986494? ?.0069737? ?143.20? ?0.000? ???.9849646? ? 1.012334
x2 |? ???1.0133? ?.0143129? ? 70.80? ?0.000? ???.9852135? ? 1.041387
_cons |? ?1.017752? ?.0314014? ? 32.41? ?0.000? ???.9561319? ? 1.079373
------------------------------------------------------------------------------
總結
以上是生活随笔為你收集整理的stata里php代码,stata命令求解惑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: W ndows xp 开机音乐,当年番茄
- 下一篇: 解析法实现多元线性回归的实例