简单eviews命令
更新时间:2023-08-20 17:03:01 阅读量: 高等教育 文档下载
全英文
ProgramminginEViews
NikolausHautschOctober16,2003
1Generalinstructions
selectfromthemenubar:file→new→program savingtheprogram(.prg)→program le executingtheprogramwithrun EViewsreferences(underhelp):
–generalprogrammingreferences:
helphelphelphelp
→→→→EViewsEViewsEViewsEViews
helphelphelphelp
topicstopicstopicstopics
→→→→
programbasicsprogramvariables
controllingaprogramsubroutines
–thecommandreferenceprovidesacompletealphabeticallistingofthecommands,views,andproceduresinEViews–thefunctionreferencecontainsacompletelistingofthefunctionsandmathematicaloperatorsusedinformingseriesexpressions,andinperformingmatrixelementoperations–thematrixandstringreferencelistsallofthematrix,vector,andscalarfunctionsandcommands–thestringreferencecontainsalistofstringfunctions
2Loadingdataandconstructingwork les
loadyourdataintoExcelsheets
createanewwork leinEViews:file→new→workfile
choosethework lefrequencyandwork lerange(accordingtothenumberofobservationsinyourExcelsheet)
UsetheExcelimportfunctionofEViews:file→import→ReadText-Lotus-Excel
Chooseyourspeci cExcel le
SpecifytheimportedrangeontheExcelsheetandthenamesoftheseries.ClickonOK. Saveyourwork le.
1
全英文
3Writingtheprogram
openanexistingwork le:openc:\mypath\mywork
or
creatinganewwork lenamedmywork:workfilemyworku110000 Allvariablesusedhavetobedeclared rst Don’tforgettosaveitfromtimetotime!
Usecommentsextensivelytounderstandyourprogramlateron,commentlinesbeginwitha’,forexample:
’thisprogramcomputesVaRonsimulateddata
4Programvariables
(seealsounderhelp→EViewssearch)
Control(program)variables:namesbeginwitha!!anfang=1
!ende=!anfang+100 Generalvariablescoefaseriesxvector(10)vmatrix(10,3)mgroupg
Stringvariables(textenclosedindoublequotes):namesbeginwitha%
%str="Thisisastring"
youcanusestringstohelpyoubuildupcommandsandvariablenamesorasheadingsintables
Manipulatingstringvariables
–convertingastringvariablecontaininganumberintoanumberbyusingthe@valfunction%str=".05"
!nmbr=@val(%strng)
–convertinganumberintoastringvariable%strng=@str(!nmbr)–concatenatingstrings
%sampleperiod=""+@str(!anfang)+""+@str(!ende) Replacementvariables:EViewsallowsyoutoconstructcommandlinesusingthecontentsofstringandcontrolvariables.!i=1
seriesx!i%strng="new"seriesx%strng}
declaresaseriesnamedx1declaresaseriesnamedx
全英文
programarguments:programargumentsarespecialstringvariablesthatarepassedtoyourprogramwhenyouruntheprogram.Argumentsallowyoutochangethevalueofstringvariableseverytimeyouruntheprogram.eq1.ls%0c%1
runregproglgdpm1performsaregressionofthevariableLGDP,onC,andM1
5Convertingseriestovectorsandviceversa
conversionfromaseriesintoavector:vector(10)vctr1=@convert(ser1) conversionofseriesintoamatrix:stom(lwage,vec1)
stom llsthevectorvec1withdatafromlwageAttention:missingvaluesareexcluded.Alternative:stomna(lwage,vec1)
conversionofamatrixtoaseriesorgroup:seriescol1seriescol2
groupgrp1col1col2mtos(mtrx1,grp1)
mtos llsthegroupgrp1withdatafrommtrx1
6Ifstatements
(seealso:help,controllingaprogram)if!a=10or%strng="yes"x=yelse
x=y+zendif
7Loops
forloops
vctr(1,1)=1
for!i=2to!ende
vctr(!i,1)=vctr(!i-1,1)*!inext
for!run=1to10
!anfang=(!runcounter-1)*100+1!ende=(!runcounter)*100
%sample=""+@str(!anfang)+""+@str(!ende)smpl%sample
全英文
sigmavector(!run=@stdev(x)next whileloops!i=1
while!i<=100!i=!i+1wend
8Subroutines
asubroutinestartswiththeword’subroutine’followedbythenameoftheroutineandanyarguments,andendswith’endsub’subroutinequot(seriesv,seriesy,scalarp)v=y/pendsub
9Workingwithtables
(seealsohelp→EViewshelptopics→workingwithtables) declaringatabletable(n,k)tab1 llingcellsofatable
setcell(tab1,x,y,u):placesscalaruinthexthrowandythcolumnoftab1
10Objectcommands
(seealso:help,objectreference)
10.1Generalcommands
showsobjectplotsseriesxfreezesoutputrestrictssample
showxplotx
freezegraph1smpl1100
全英文
10.2Regressioncommands
OLSregressionofyonx1,x2,x3ARCH(p,q)regression
Twostageleastsquareswithinstrumentsz1,z2,z3displaysgraphsoftheresidualscoe cientvector
vectorofstandarderrorsforcoe cients
sumofsquaredresidualsbasedonOLSregression
runningaVAR(1)(namevar1)fory1andy2inaprogramresidualcovariancematrixofthe(VAR)systemvar1
ls(options)yx1x2x3
arch(p,q,options)yx1x2x3
tsls(options)yx1x2@z1z2z3resids@coefs@stderrs@ssr
varvar1.ls11y1y2cvar1.@residcov
10.3Graphiccommands
bargraphsxygraph
barser1ser2ser3xy
11
11.1
Functions
Timeseriesfunctions
1 n 1
n-periodbackwardmovingaverage: j=0Xt j
n 1
n-periodbackwardmovingsum:j=0Xt j1storderdi erenceofseriesX:Xt Xt 1
1storderdi erenceoflogarithmofseriesX:ln(Xt) ln(Xt 1)
@movav(X,n)@movsum(X,n)d(X)dlog(X)
11.2Statisticaldistributionfunctions
cumulativedensityfunctionofnormaldistributiondensityfunctionofnormaldistributionquantileofnormaldistribution
generatesnormallydistributedrandomvariablesquantileoftvdistribution
generatestvdistributedrandomvariablesquantileofχ2vdistribution
generatestvdistributedrandomvariables
@cnorm(x)@dnorm(x)@qnorm(p)@rnorm
@qtdist(p,v)@rtdist(v)@qchisq(p,v)@rtdist(v)
全英文
11.3Descriptivestatisticfunctions
numberofelementsofgroup’grp1’nameofithelementofgroup’grp1’absolutevalueexponential
naturallogarithm(ln)squareroot nsumofallX:=1Xt tn
2sum-of-squares:t=1Xt
numberofelementsinx
maximumoftheseriesXminimumoftheseriesXmedianoftheseriesXmeanoftheseriesX
standarddeviationoftheseriesXq-thquantileoftheseriesX
correlationbetweentheSeriesXandY1storderautocorrelationcovariance
computestheCholeskydecompositionofm1
largestintegernotgreaterthanx,e.g.@ oor(1.23)=1
grp1.@count
%str=grp1.@seriesname(i)@abs(x)@exp(x)@log(x)@sqr(x)@sum(X)@sumsq(X)@obs(x)@max(X)@min(X)@median(X)@mean(X)@stdev(X)
@quantile(X,q)@cor(X,Y)
@cor(X,X(-1))@cov(X,Y)
@cholesky(m1)@floor(x)
11.4Matrixfunctions
placesthecolumnvectorvintothematrixmatcolumnnplacestherowvectorrintothematrixmatrown
placesthematrixm2intom1atrown1andcolumnn2Choleskyfactorizationofs
extractsavectorfromcolumnnofthematrixobjectmextractsarowvectorfromrownofthematrixobjectmnumberofcolumnsinthematrixobjectoquantileoftvdistribution
generatestvdistributedrandomvariablesquantileofχ2vdistribution
generatestvdistributedrandomvariables
colplace(m,v,n)rowplace(m,v,n)
matplace(m1,m2,n1,n2)@cholesky(s)
@columnextract(m,n)@rowextract(m,n)@columns(o)@qtdist(p,v)@rtdist(v)@qchisq(p,v)@rtdist(v)
12Operators
+,-,*,/,^>,<,=,<><=,>=and,or
add,subtract,multiply,divide,raisetopowergreater,less,equal,notequal
lessthanorequal,greaterthanorequallogicaland,logicalor
(seealso:help,functionreference)
正在阅读:
简单eviews命令08-20
人教新课标六年级下册语文试题-期末测试卷 (含答案)04-16
ANSYS梁单元如何正确提取应力04-09
S.D.Lu的MSP430入门学习笔记(5):看门狗定时器和低功耗模式08-12
中国土地制度的演变10-13
市场营销学B卷12-26
血透室护理质量控制检查标准 - 图文03-13
综合防控儿童青少年近视工作实施方案08-03
计量经济学(庞浩)第二版第十一章练习题及参考解答(优选.)04-17
大学英语B6套模拟试题05-25
- 2012诗歌鉴赏讲座 师大附中张海波
- 2012-2013学年江苏省苏州市五市三区高三(上)期中数学模拟试卷(一)
- 市政基础设施工程竣工验收资料
- 小方坯连铸机专用超越离合器(引锭杆存放用)
- 荀子的学术性质之我见
- 氩弧焊管轧纹生产线操作说明
- 小学科学六年级上册教案
- (商务)英语专业大全
- 外汇储备的快速增长对我国经济发展的影响
- 幼儿园中班优秀语言教案《小猴的出租车》
- 第七章 仪表与显示系统
- 身份证号码前6位行政区划与籍贯对应表
- 单位(子单位)工程验收通知书
- 浅谈地铁工程施工的项目成本管理
- 沉积学知识点整理
- 前期物业管理中物业服务企业的法律地位
- 2014微量养分营养试卷
- 地质专业校内实习报告范文(通用版)
- 内部审计视角下我国高校教育经费支出绩效审计研究
- 高次插值龙格现象并作图数值分析实验1
- 命令
- 简单
- eviews