全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
9846 8
2012-02-25
第一,就是怎么换行输入两条命令 因为回车就直接执行了 ,可以输入两条以上的命令么
第二,就是预测命令predict, 我用regress y x回归后,怎么样对y预测呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-2-25 07:38:09
第一,就是怎么换行输入两条命令 因为回车就直接执行了 ,可以输入两条以上的命令么
https://bbs.pinggu.org/thread-309324-1-1.html
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-2-25 07:39:24
第二,就是预测命令predict, 我用regress y x回归后,怎么样对y预测呢?
predict yh
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-2-25 09:04:27
Examples

    -----------------------------------------------------------------------------------------------
    Setup
        . sysuse auto
        . regress mpg weight c.weight#c.weight foreign

    Obtain predicted values
        . predict pmpg
        . summarize pmpg mpg

    -----------------------------------------------------------------------------------------------
    Setup
        . webuse newautos, clear

    Obtain out-of-sample prediction
        . predict mpg

    Obtain standard error of the forecast
        . predict se_mpg, stdf

    -----------------------------------------------------------------------------------------------
    Setup
        . sysuse auto, clear
        . regress price weight foreign##c.mpg

    Residual-versus-fitted plot
        . rvfplot, yline(10)

    Added-variable plot
        . avplot mpg

    Added-variable plots for every regressor
        . avplots

    -----------------------------------------------------------------------------------------------
    Setup
        . webuse auto1
        . regress price mpg weight

    Component-plus-residual plot
        . cprplot mpg, mspline msopts(bands(13))

    Augmented component-plus-residual plot
        . acprplot mpg, mspline msopts(bands(13))

    Residual-versus-predictor plot
        . rvpplot mpg, yline(0)

    -----------------------------------------------------------------------------------------------
    Setup
        . sysuse auto
        . regress mpg weight c.weight#c.weight foreign

    Diagonal elements of projection matrix
        . predict xdist, hat

    -----------------------------------------------------------------------------------------------
    Setup
        . sysuse auto, clear
        . regress price weight foreign##c.mpg

    Leverage-versus-residual-squared plot
        . lvr2plot

    Standardized residuals
        . predict esta if e(sample), rstandard

    Studentized residuals
        . predict estu if e(sample), rstudent

    -----------------------------------------------------------------------------------------------
    Setup
        . sysuse auto, clear
        . regress price weight foreign##c.mpg

    DFITS influence measure
        . predict dfits, dfits

    Cook's distance
        . predict cooksd if e(sample), cooksd

    Welsch distance
        . predict wd, welsch

    COVRATIO influence measure
        . predict covr, covratio

    DFBETAs influence measure
        . sort foreign make
        . predict dfor, dfbeta(1.foreign)

    DFBETAs for all variables in regression
        . dfbeta

    Ramsey's test for omitted variables
        . estat ovtest

    Test for heteroskedasticity
        . estat hettest
        . estat hettest weight foreign##c.mpg, mtest(b)

    Rank test for heteroskedasticity
        . estat szroeter, rhs mtest(holm)

    Tests for heteroskedasticity, skewness, and kurtosis
        . estat imtest

    -----------------------------------------------------------------------------------------------
    Setup
        . webuse bodyfat, clear
        . regress bodyfat tricep thigh midarm

    Variance inflation factors
        . estat vif

    -----------------------------------------------------------------------------------------------
    Setup
        . webuse nhanes2

    Regress systolic blood pressure on age group, sex, and their interaction
        . regress bpsystol agegrp##sex

    Predictive margins of blood pressure for age groups
        . margins agegrp

    Profile plot of margins
        . marginsplot

    Margins for interaction between age group and sex
        . margins agegrp#sex

    Interaction plot
        . marginsplot

    Estimate for each age group a contrast comparing men and women
        . margins r.sex@agegrp

    Plot contrasts and confidence intervals against age group
        . marginsplot
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-2-25 09:05:38
论坛上面已经有很多初级的,stata的,中文的书了。
那几本书随便把一本看看,这些问题懂能自己解决了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-2-25 11:52:52
sungmoo 发表于 2012-2-25 07:39
predict yh
(option xb assumed; fitted values)

这个怎么处理呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群