stata回归分析

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

kkxxxy22110),0(2~Niid寻找回归关系graphboxvarlist建立回归方程,进行计算regressvar(independentvariable)varlist(dependentvariables)残差及其相关信息predict,(residual/rsstudent/xb/stdp/cooksd/leverage/)回归拟合图twoway残差及模型适合性检验残差:rvfplot(aresidual-versus-fittedplot)rvpplot(aresidual-versus-predictorplot)lvr2plot(aleverage-versus-squared-residualplot)正态性:pnorm;kdensity,normal;histogram,normal;sktest;swilk;多重共线性:vif异方差性:estathettest;estatimtest(峰度、偏度)outregestimatestore,estimatetablexml_tab;outreg2;estout;modltbl;mktab;outtex;est2texsysuseauto,cleargraphmatrixweightlengthdisplacementregressweightlengthdisplacementregressweightlengthpredictwhpredicte,residualtwowayscatterweightlength||linewhlengthscatterewhrvfplotrvpplotlengthpnormesktesteswilkekdensitye,normalhistograme,normalestathettestestatimtest为了研究回归关系的预测性,在回归分析中,并不是将所有的数据都用于模型参数估计,而是一部分用于估计,剩下一部分用于预测,检测预测值和真是值的关系。Stata中,运用e(sample)进行部分回归和预测。clearsysuseautosortmakeregmpgweightdisplacementheadroomifforeign==0predictr1ife(sample),rpredictr2if~e(sample),rpredictmpg_hat,xbsumr2clearsysuseautoregmpgweightoutregusingd:\temp.txt,replace3asterbdec(4)tdec(4)nolregmpgdisoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)nolregmpgheadroomoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)nolregmpgweightdisheadroomoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)nolregmpgweightdisheadroomforeignoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)nolclearsysuseautoregmpgweightoutregweightusingd:\temp.txt,replace3asterbdec(4)tdec(4)nolregmpgweightdisheadroomoutregweightusingd:\temp.txt,append3asterbdec(4)tdec(4)nolregmpgweightdisheadroomforeignoutregweightusingd:\temp.txt,append3asterbdec(4)tdec(4)nolclearsysuseautoregmpgweightoutregusingd:\temp.txt,replace3asterbdec(4)tdec(4)noladjr2regmpgdisoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2regmpgheadroomoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2regmpgweightdisheadroomoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2regmpgweightdisheadroomforeignoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2clearsysuseautotableforeigntableforeign,nolsummpgifforeign==0summpgifforeign==1tabstatmpg,s(Nmeanmediansdminmax)by(foreign)c(s)regmpgforeignclearsysuseautoregmpgweightgear_ratiolengthheadroomifforeign==0outregusingd:\temp.txt,replace3asterbdec(4)tdec(4)noladjr2regmpgweightgear_ratiolengthheadroomifforeign==1outregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2regmpgweightgear_ratiolengthheadroomforeignoutregusingd:\temp.txt,append3asterbdec(4)tdec(4)noladjr2clearwebuseunionprobitunionagegradenot_smsasouthlogitunionagegradenot_smsasouth

1 / 15
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功