上机实验4Eviews序列的操作Word文档下载推荐.docx

上传人:b****5 文档编号:8467698 上传时间:2023-05-11 格式:DOCX 页数:14 大小:161.65KB
下载 相关 举报
上机实验4Eviews序列的操作Word文档下载推荐.docx_第1页
第1页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第2页
第2页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第3页
第3页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第4页
第4页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第5页
第5页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第6页
第6页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第7页
第7页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第8页
第8页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第9页
第9页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第10页
第10页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第11页
第11页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第12页
第12页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第13页
第13页 / 共14页
上机实验4Eviews序列的操作Word文档下载推荐.docx_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

上机实验4Eviews序列的操作Word文档下载推荐.docx

《上机实验4Eviews序列的操作Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《上机实验4Eviews序列的操作Word文档下载推荐.docx(14页珍藏版)》请在冰点文库上搜索。

上机实验4Eviews序列的操作Word文档下载推荐.docx

^

raisetothepower

<

lessthan

=

lessthanorequalto

notequalto

equalto

greaterthan

greaterthanorequalto

根据已知序列生成各种新序列的@函数

@pch(x)=(x-x(-1))/x(-1)@seas(n)(seasonaldummy)

@sin(x)@cos(x)@tan(x)@asin(x)@acos(x)@atan(x)@round(x)

genr变量名=表达式

genrxx=x^2genryy=val*y

genrzz=x*y(对应分量相乘)genrzz=log(x*y)(各分量求对数)

genrlnx=log(x)genrx1=1/x

genrDx=D(x)genrvalue=3(注意与标量的区别)

genrhx=x*(x>

=3)(同维新序列,小于3的值变为0,其余数值不变)

xy=x>

三、序列的随机生成:

@r开头指随机数生成器

四、盒图

wfopengarch

groupgraaar3

freeze(gfb)g.boxplot

showgfb

产生盒图的命令中,boxplot是群对象命令,进行多个序列的盒图比较。

而boxplotby是序列对象的命令,绘制单个序列内不同分组的盒图。

修改盒图元素的命令为setbpelem.例如

Copygfbgfn

Gfn.setbpelemci(notch)将盒图中间的阴影部分改为凹槽。

Basicexamples

wage.boxplot

displaysboxplotsfortheseriesWAGE.

groupg1wagesexrace

g1.boxplot

displaysboxplotsforWAGES,SEXandRACEinasinglegraphframe.

g1.boxplot(m,rotate)

placestherotatedboxplotsforeachseriesinaseparateframe.

Panelexamples

ser1.boxplot(panel=individual)

displaysboxplotsforeachcross-sectioninaseparateframe,while,

ser1.boxplot(panel=stack)

displaysasingleboxplotcomputedfromthestackedpaneldata.

ser1.boxplot(panel=combined,rotate)

showsrotatedboxplotscomputedforeachperiod(acrosscross-sections)inasingleframe.

Categoricalspecexamples

ser1.boxplotacross(firm,dispname)

displaysacategoricalboxplotgraphofSER1usingdistinctvaluesofFIRMtodefinethecategories,anddisplayingtheresultinggraphsinmultipleframeswithcommonscaling.EachframeislabeledusingtheFIRMdisplayname.

ser1.boxplotacross(firm,dispname,iscale)

constructsthesamegraphwithindividualscaling.

ser1.boxplotwithin(firm,label=value)

constructsaboxplotforeachvalueofFIRManddisplaystheresultsinasingleframe.TheindividualboxplotsarelabeledusingthevalueofFIRMassociatedwiththecategory.

ser1.boxplotacross(firm)within(income,bintype=quant,bincount=4)

constructsacategoricalboxplotwithFIRMdefiningtheacrossdimension,andINCOMEdefiningthewithindimension.BoxplotsforeachINCOMEquartileofagivenfirmwillbecontainedinasingleframe,withdifferentfirmsdisplayedindifferentframes.

grp1.boxplotwithin(sex)within(union)

createsanboxplotforwithincategoriesbasedonbothSEXandUNION.Sincewehavenotspecifiedbehaviorfortheimplicit@SERIESinGRP1,eachseriesinthegroupwillbedisplayedinaseparateframe,withindividualscaling.

五、QQ图

Quantile-quantileplots.qqplotplotsthe(empirical)quantilesofaseriesagainstthequantilesofatheoreticaldistributionorthequantilesofanotherseries.Youmayspecifythetheoreticaldistributionand/orthemethodusedtocomputetheempiricalquantilesasoptions;

seeoptionsbelow.

Syntax

SeriesView:

series_name.qqplot(options)

Options

nplotagainstthequantilesofanormaldistribution.

uplotagainstthequantilesofauniformdistribution.

eplotagainstthequantilesofanexponentialdistribution.

lplotagainstthequantilesofalogisticdistribution.

xplotagainstthequantilesofanextremevaluedistribution.

s=series_nameplotagainstthe(empirical)quantilesofthespecifiedseries.

q=r(default)computequantilesusingtheRankit(Cleveland)formula.

q=ocomputequantilesusingthesimplefraction(ordinary)formula.

q=vcomputequantilesusingthevanderWaerdenformula.

q=bcomputequantilesusingtheBlomformula.

q=tcomputequantilesusingtheTukeyformula.

pPrinttheQQ-plot.

Examples

equationeq1.binary(d=l)workceduagerace

eq1.makeresid(o)res1

res1.qqplot(l)

estimatesalogit,retrievestheresiduals,andplotsthequantilesoftheresidualsagainstthosefromthelogisticdistribution.Iftheerrordistributioniscorectlyspecified,theQQ-plotshouldlieonastraightline.

StatisticalGraphs

比较两个分布的工具。

如果分布相同,QQ图应该是一条直线。

理论QQ图(正态分布n,均匀分布u,指数分布e,Logistic分布l,第一类极值分布x),经验QQ图(s=name).

serieswage=exp(lnwage)

groupwwagelog(wage)

freeze(gfw)w.qqplot(n)

showgfw

gfw.align(2,1,1)

wfopendemo

rndseed(type=mt)12357

groupdist@rnorm@rchisq(5)

freeze(gf)rs.qqplot(s=dist)

showgf

gf.align(2,1,1)

六、核密度函数图:

如何绘制序列和某种分布的PDF?

Kerneldensityplots.Displaysnonparameterickerneldensityestimatesofthespecifiedseries.

series_name.kdensity(options)

k=e(default)Epanechnikovkernel.

k=rTriangularkernel.

k=uUniformkernel.

k=nNormal(Gaussian)kernel.

k=bBiweight(Quartic)kernel.

k=tTriweightkernel.

k=cCosinuskernel.

s(default)Automaticbandwidth(Silverman).

b=numberSpecifyanumberforthebandwidth.

bBracketbandwidth.

n(default=100)Numberofpointstoevaluate.

xExactevaluationofkerneldensity.

pPrintthekerneldensityplot.

lwage.kdensity(k=n)

plotsthekerneldensityestimateofLWAGEusinganormalkernelandtheautomaticbandwidthselection.

series_name.kdensity(options)

Dors.distplotkernel(@obsrange,b=3,o=mrs)

seriesx

seriesrsk

groupgxrsk

mtos(mrs,g)

genry=@dchisq(x,5)

y.displaynamechi-squre(5)

rsk.displaynameinterestrate

graphgfd.xylinexyrsk

showgfd

gfd.legend-inboxposition(2.4,0.2)columns

(1)

七、经验分布函数图

Empiricaldistributionfunctions:

displaysempiricalcumulativedistributionfunctions,survivorfunctions,andquantileswithstandarderrors.

series_name.cdfplot(options)

GroupView:

group_name.cdfplot(options)

sPlottheempiricalsurvivorfunction.

qPlottheempiricalquantiles.

aPlotallCDF,survivor,andquantiles.

nDonotincludestandarderrors.

q=r(default)ComputequantilesusingtheRankit(Cleveland)formula.

q=oComputequantilesusingthesimplefraction(ordinary)formula.

q=vComputequantilesusingthevanderWaerdenformula.

q=bComputequantilesusingtheBlomformula.

q=tComputequantilesusingtheTukeyformula.

pPrintthedistributionfunction(s).

ToplottheempiricalcumulativedistributionfunctionoftheseriesLWAGE:

lwage.cdfplot

cdfpdf

(Eviews3series_name.cdfplot(options),Eviews5cdfplot)

Eviews7series_name.distplotcdf

Distplotcdf命令,默认绘制累积分布函数函数(选项c),还支持生存函数(选项s)和分位数函数(选项q)。

例如

lnwage.distplotcdf

(说明:

showsthecumulativedistributionplotforlnwage,alongwiththedefault95%confidenceintervals.)

lnwage.distplotcdf(noci)则是不显示95%的置信区间

lnwage.distplotsurvivor(noci)

groupgro1weightheight

gro1.distplotlogsurvivor(ci=0.9,leg=det)

(说明displaysthelog-survivorplotsforWEIGHTandHEIGHTalongwith90%confidenceintervals,andadetailedlegend.Theplotswillbedisplayedinindividualgraphframes.)

gro1.distplot(s)quantile

(说明showsthequantileplotsforWEIGHTandHEIGHTinthesamegraphframe.)

 

TimeSeriesFunctions

StatisticalDistributionFunctions

@chisq(x,v)@fdist(x,v1,v2)@tdist(x,v)(统计量样本值在有关分布图中拒绝域的概率),如@tdist(3.45,12)=Prop(|t(12)|>

3.45)=0.0048,当显著性水平为1%,则可拒绝原假设),其中3.45是此t统计量样本值的绝对值。

@c开头指CDF=Prop(X≤x);

@q开头指逆CDF=q*:

Prop(X≤q*)=p;

如@cfdist(60.71,12,1)=0.90,@qtdist(0.05,1)=-6.314;

又如自由度为12的t统计量的5%显著水平(双尾)的临界值@qtdist(0.975,12)=2.179

AdditionalDistributionFunctions

7)Jarque-Bera统计量:

,用于检验变量是否服从正态分布。

在变量服从正态分布的原假设下,JB统计量服从自由度为2的卡方分布。

如果JB统计量大于卡方分布的临界值,或对应概率值较小,则拒绝该变量服从正态分布的假设(whereSistheskewness,Kisthekurtosis,andkrepresentsthenumberofestimatedcoefficientsusedtocreatetheseries)

在工作文件中,生成时间序列变量

seriestime=@trend(1990:

1)

seriestime1=@obsnum

生成季度虚拟变量

workfilemyworkm1990:

012000:

12

seriesm=@month

生成月度虚拟变量

workfilemyworkq1990:

04

seriesm=@quarter

生成时间段虚拟变量

workfilemyworka19502000

smpl19501978

seriesdum=0

smpl19792000

dum=1

smpl@all

1.根据年份变量生成一个虚拟变量

比如你有一个数据,数据里面有一个变量year,你想根据year生成一个虚拟变量d1,2000年及以后取值为1,2000年以前取值为0。

可以用如下的命令实现:

seriesd1=(year>

=2000)

2.如何根据季度频率的数据生成季度虚拟变量。

季度有春夏秋冬,故可以生成四个虚拟变量,但是引入到模型的时候引入3个就可以。

比如说你想生成三个季度虚拟变量q1(是否为春季),q2(是否为夏季),q3(是否为秋季)。

可以用如下的命令:

seriesq1=@seas

(1)

seriesq2=@seas

(2)

seriesq3=@seas(3)

3.如何把一个行业变量转化为虚拟变量

如果你的行业变量有A,B,C,D共4个取值,就可以生成4个虚拟变量d1,d2,d3,d4,相关命令如下:

seriesd1=(ind=”A”)

seriesd1=(ind=”B”)

seriesd1=(ind=”C”)

seriesd1=(ind=”D”)

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 幼儿教育 > 幼儿读物

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2