Eviews作图操作27页文档资料.docx

上传人:b****5 文档编号:6927128 上传时间:2023-01-12 格式:DOCX 页数:19 大小:37.86KB
下载 相关 举报
Eviews作图操作27页文档资料.docx_第1页
第1页 / 共19页
Eviews作图操作27页文档资料.docx_第2页
第2页 / 共19页
Eviews作图操作27页文档资料.docx_第3页
第3页 / 共19页
Eviews作图操作27页文档资料.docx_第4页
第4页 / 共19页
Eviews作图操作27页文档资料.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

Eviews作图操作27页文档资料.docx

《Eviews作图操作27页文档资料.docx》由会员分享,可在线阅读,更多相关《Eviews作图操作27页文档资料.docx(19页珍藏版)》请在冰豆网上搜索。

Eviews作图操作27页文档资料.docx

Eviews作图操作27页文档资料

Eviews7中的图形操作

Wfcreatewfopenwfselectwfstatswfsave

一、图形的分类

1.线条图,如errbar、hile、line、spike

2.填充图,如area、bar、pie

3.XY图,如xy、xyline、xypair、scat

4.统计图,如boxplot、cdfplot、hist、distplotkernel、qqplot

5.其他对象的特有图形,如方程对象的置信椭圆cellipse

图形能方便地实现数据和计量分析结果的可视化。

图形对象包含对象的图形视图和图形对象。

可以把图象视图定格成图形对象再进行修改。

二、创建图形对象

图形可以用graph命令创建,也可以从其他对象的图形视图定格而来。

如graphgf.linegdp(或graphgfgdp,默认为线条图)

用freeze命令把其他对象的图形视图定格成图形对象。

如freeze(gf)gdp.line

merge命令是合并已有的图形对象

freeze(g1)gdp.line

showg1

graphg2.barm1

showg2

graphg3.mergegfgg

showg3

多个子图,用align命令设置排列方式,例如

Graphgfan.line(m)log(gdp)log(m1)rs

Gfan.align(2,1.5,1)

三、定制图形

图形对象可以通过程序修改的部分有:

线型(pattern)和填充,图例(legend)和图框(frame),坐标轴,还可以在图形对象上增加文本、线和阴影等。

1.图框使用options命令,例如

graphgf1.liners

Copygf1gf2

Gf2.optionsindent(缩进)

Copygf1gf3

Gf3.options–inbox(去掉边框)

Copygf1gf4

Gf4.optionssize(8,3)(修改为8,3虚拟英寸)

Graphgffr.mergegf1gf2gf3gf4

Gffr.legend–display

Gffr.align(2,1,1)

Deletegf?

2.坐标轴

有些图形命令,如line,对多个序列作图时,有如下坐标轴选项:

a:

自动选择坐标轴,横轴在底部,纵轴在左边。

d:

双坐标轴,第一个序列对应左边的坐标轴,其他序列对应右边的坐标轴,第一个序列的图形与其他序列不相交。

x:

同d,但允许相交。

n:

将序列标准化。

例如

graphgf1.linerspr

copygf1gf2

gf2.scale(left)log(采用对数坐标)

copygf1gf3

gf3.setelem

(2)axis(right)(将价格水平的坐标放到右边)

copygf3gf4

gf4.scaleoverlap(允许相交)

graphgfas.mergegf1gf2gf3gf4

gfas.align(2,2,2)

deletegf?

showgfas

命令scale有invert和range等选项,设置反向坐标轴和坐标轴的标注范围。

Graphgf1.linelog(gdp)

Copygf1gf2

Gf2.scaleinvert

Copygf1gf3

Gf3.scalelinearzero

Copygf1gf4

Gf4.scalerange(4,8)

Graphgfa1.mergegf1gf2gf3gf4

Gfa1.legend–display

Gfa1.align(2,1,1)

Deletegf?

Showgfa1

坐标的外观,时间标度等也可以进行设置。

例如

Graphgf1.linelog(rs)

Copygf1gf2

Gf2.axismirrorzeroline(增加零线,左右同时给出刻度)

Copygf1gf3

Gf3.datelabelinterval(year,10)(横轴刻度是10年)

Copygf1gf4

Gf4.axis–labelgridticksin(去掉标度,增加网格线,刻度在里面)

Graphgfag.mergegf1gf2gf3gf4

Gfag.legend–display

Gfag.align(2,1,1)

Deletegf?

Showgfag

wfopenhs

smpl1988@last

graphgf1.linehs

showgf1

gf1.datelabelformat(yyyy)interval(year,1)

gf1.legend-display

copygf1gf2

showgf2

gf2.datelabelformat(yyyy)interval(year,1)-span

graphgf.mergegf1gf2

gf.align(2,1,1)

showgf

3.颜色和线型

wfopendemo

smpl1990@last

graphgf1.linegdpm1

copygf1gf2

showgf2

gf2.setelem

(2)lcolor(orange)lwidth

(2)

copygf1gf3

showgf3

gf3.setelem

(1)lpat(dash1)symbol(star)

copygf3gf4

showgf4

gf4.options-color

Graphgf1c.mergegf1gf2gf3gf4

Gf1c.align(2,1,1)

Deletegf?

Smpl@all

Showgf1c

4.填充和纹线

matrix(2,3)mm

mm.fill1,5,3,4,6,2

showmm

freeze(gf1)mm.bar

showgf1

Copygf1gf2

Gf2.options–color

showgf2

gf2.options-color

copygf1gf3

gf3.setelem

(1)gray(5)hatch(7)

gf3.setelem

(2)gray

(1)hatch(3)

gf3.setelem(3)gray(3)hatch(4)

copygf3gf4

showgf4

gf4.options-color

graphgff.mergegf1gf2gf3gf4

gff.align(2,2,2)

showgff

5.标注

可以用addtext命令在图形中添加文字,用draw命令突出某些内容。

例如graphgf1.liners

showrs

closers

showgf1

copygf1gf2

gf1.addtext(t)"shorttreminterestrate"

gf1.addtext(l)"percent"

showgf2

gf2.draw(shade,bottom,rgb(235,200,180))8085

gf2.draw(dashline,left,color(red))8

graphgfat.mergegf1gf2

gfat.align(2,1,1)

gfat.legend-display

showgfat

6.图例

可以控制图例的位置、文本和外观。

graphgf1.linelog(gdp)log(m1)prrs

showgf1

gf1.name(3)PriceLevel

copygf1gf2

gf2.legend-inboxposition(0.4,0.5)columns

(1)

gf2.name(4)

graphgfag.mergegf1gf2

gfag.align(2,2,2)

showgfag

gfag.legendfont(20)设置字体

gfag.legend–display不要图例

四、图形模板

通过模板,可以复制图形类型、线型和填充的设置、坐标轴的标度方式、图例的各种属性和图框的各种设定等。

graphgf0.linelog(gdp)log(m1)

showgf0

gf0.setelem

(1)lwidth(4)

gf0.setelem

(2)symbol

(1)

gf0.draw(shade,bottom)8085

graphgf1.line(o=gf0)pr*10rs

showgf1

graphgf2.line(t=gf0)pr*10rs

showgf2

还可以在图形创建后再应用模板,例如

Graphgf1.linepr*10rs

Gf1.template(o)gf0

Graphgf2.linepr*10rs

Gf2.template(t)gf0

五、打印和导出

保存成图形文件。

Save命令支持三种常用的矢量图形文件,分别是wmf文件、emf文件、eps文件。

例如

gf2.save(t=wmf,u=in,w=4,-c)mygf

命令名:

freeze\graph\save\merge\align\template\options\name\addtext\legend\draw\scale\setelem

直方图

x.distplothist

关键字hist为命令distplot的分析设定(analyticalspec)。

hist有自己的选项。

标度类型:

scale={dens,freq,relfreg},分别表示密度直方图、频数直方图(默认)和频率直方图。

柱宽:

binw={eviews,sigma,iqr,silverman,freefman}.

锚点:

anchor=num

分界点:

rightclosed

图例文字:

leg={def,n,s,det},默认给出最少信息,其他三个选项对应的图例文字信息分别为无文本、短文本和详细信息。

折现直方图:

distplotfreqpoly

边线直方图:

distplotedgefreqpoly

移位直方图:

distplotash

wfopendemo

gdp.hist

freeze(gf01)gdp.distplotfreqpoly

showgf01

Freeze(gf02)gdp.distplotedgefreqpoly(fill)

showgf02

freeze(gf03)gdp.distplothistash

showgf03

freeze(gf04)gdp.distplothist(binw=silverman,anchor=0.6)ash

showgf04

增加正态分布曲线:

选中要画图的序列,打开,点view/gragh在specific里选中distribution,右边的distribution框选择histogram。

点击右边的option,在弹出来的框里点add,弹出的add框里选TheoreticalDensity。

点击ok再点击ok。

最后点击ok。

经验分布函数图

Eviews5cdfplot

Eviews7distplotcdf

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.)

QQ图

比较两个分布的工具。

如果分布相同,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.如何绘制序列和某种分布的PDF?

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)

盒图

wfopengarch

groupgraaar3

freeze(gfb)g.boxplot

showgfb

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

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

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

Copygfbgfn

Gfn.setbpelemci(notch)

将盒图中间的阴影部分改为凹槽。

Syntax语法

boxplot(options)o1[o2o3...]

object_name.boxplot(options)[categorical_spec(arg)]

whereo1,o2,...,areseriesorgroupobjects.Youmayspecifygeneraloptionsaftertheboxplotkeyword.

Theoptionalcategorical_specallowsyoutospecifyacategoricalgraph(see"CategoricalSpec").

Options

q=arg

Setthequantilemethod,whereargcanbe:

"r"-Rankit-Cleveland,"o"-Ordinary,"v"-vanderWaerden,"b"-Blom,"t"-Tukey,"g"-Gumbel.

rotate

Rotatethegraphsotheobservationaxisisontheleft.

Multipleseriesoptions(categoricalgraphsettingswilloverridetheseoptions)

m

Plotboxplotsinmultiplegraphs.

Paneloptions

Thefollowingoptionapplieswhengraphingpanelstructureddata:

panel=arg(defaulttakenfromglobalsettings)

Paneldatadisplay:

"stack"(stackthecross-sections),"individual"or"i"(separategraphforeachcross-section),"combine"or"c"(computecross-sectiongraphsinasingleframe).

(Note:

moregeneralversionsofthesepanelgraphsmaybeconstructedascategoricalgraphs.)

Examples

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.

graph_name.setbpelemelement_list

Theelement_listmaycontainoneormoreofthefollowing:

median,med/-median,-med

[Show/Donotshow]themedians.

mean/-mean

[Show/Donotshow]themeans.

whiskers,w/-whiskers,-w

[Show/Donotshow]thewhiskers(linesfromtheboxtothestaples).

staples,s/-staples,-s

[Show/Donotshow]thestaples(linesdrawnatthelastdatapointwithintheinnerfences).

near/-near

[Show/Donotshow]thenearoutliers(valuesbetweentheinnerandouterfences).

far/-far

[Show/Donotshow]thefaroutliers(valuesbeyondtheouterfences).

width(arg)(default="fixed")

Setthewidthsettingsfortheboxplots,where

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

当前位置:首页 > 初中教育 > 初中作文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1