请教一个关于gauss的问题-经管之家官网!

人大经济论坛-经管之家 收藏本站
您当前的位置> 软件培训>>

Gauss软件培训

>>

请教一个关于gauss的问题

请教一个关于gauss的问题

发布:sevennightliu | 分类:Gauss软件培训

关于本站

人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!

获取电子版《CDA一级教材》

完整电子版已上线CDA网校,累计已有10万+在读~ 教材严格按考试大纲编写,适合CDA考生备考,也适合业务及数据分析岗位的从业者提升自我。

完整电子版已上线CDA网校,累计已有10万+在读~ 教材严格按考试大纲编写,适合CDA考生备考,也适合业务及数据分析岗位的从业者提升自我。

论坛的高手们,小弟请教一个gauss的问题。我现在想利用一个gauss代码来检验我的一个时政问题,而且已经有相关的代码了,但gauss实在没有接触过,请求有没有人能够教我怎么运用下面这个代码呢?这个代码编写的依据是L ...
免费学术公开课,扫码加入


论坛的高手们,小弟请教一个gauss的问题。
我现在想利用一个gauss代码来检验我的一个时政问题,而且已经有相关的代码了,但gauss实在没有接触过,请求有没有人能够教我怎么运用下面这个代码呢?这个代码编写的依据是LEE & Strazicich(2004)的允许结构突变的稳定性检验,我想用这个方法来检验自己的时间序列,本人的时间序列也很简单,不是面板,就是一个53个观察值单一时间序列,问下谁能帮我运用一下呢,告诉我怎么做。
代码附件传不来:
@Written/Modified by: Junsoo Lee Disclaimer: This code is provided gratis without any guarantees or warrantees.Proprietary modifications of this code are not permitted.@/* LM test using one break.See also, SP.g,LS_two.g, panel_sp.g (no break), panel_one.g (one break), panel_tw.g (two breaks)Lee and Strazicich (2004) Minimum LM unit root test with one structural break.Reference paper: Lee, Junsoo, and Mark C. Strazicich, 2004, Manuscript,Department of Economics, Appalachian State University.See also: Lee, Junsoo, and Mark C. Strazicich, 2003,"Minimum Lagrange Multiplier Unit Root Test with Two Structural Breaks."The Review of Economics and Statistics, 85(4): 1082-1089.program: LS_ONE.gNotes:To correct for serial correlations by including k first differenced lagged (augmented) terms,the program first determines the optimal lag length (k) at each possiblebreak point.The optimal lag length is determined by a general to specific procedure.Starting with the maximum number of lags, maxk, the t-statistic on the maximum lagged termis examined to see if significant at the asymptotic 10% level.If not, the maximum lagged term is dropped and the test is repeated until the maximum lagged term is significant, or no lags are found (see, for example, Ng and Perron, 1995).Once the optimal lag length at each break point is determined, the program searches for the break point where the unit root t-test statistic is minimized.Model 1 includes one structural change in the intercept or level of the time series.Model 2 includes one structural change in the intercept and trend slope.To run the program below, you must name the output file, choose the maximum lag length k (8 in the example below), enter the number of observations in each time series (51 in the example below),enter the number of time series tested (43 in the example below), enter the name of thedata source file, and give each time series a name. */@ ================================================================ @output file = "LS_one_gdp.out" reset; "SP-LM t-stat with the data-dependent choice of # lags ";@ ================================================================ @/* Options*/ maxk = 8; @ # maximum augmentation lags allowed for @ T1_end = .1; T2_end = .9; @ End points (10% of both ends are not considered) @ crit_t = 1.645; @ critical value of the t-stat for lag determination @ n = 50; @ # of observations @ y = cumsumc(rndn(n,1)); @ Or, Read the dat file here. ->load y[n,1] = data.txt;@ ""; ""; format /rd/m1 4,0; "Date : ";; tt=date; tt[1:3]'; ""; "max p : " maxk; format /rd/m1 4,1;@ ==== DATA ====================================================== @/* load data[45,20] = c:\work\hyster\unemp2.txt; "Data: Unemp2.txt"; let name = Year Australia Austria Belgium Canada Denmark Finland France Germany Ireland Italy Japan Netherlands Norway Newzealand Spain Sweden Switzerland UK USA; jjj = 2; do while jjj <= 20; y = data[.,jjj]; @ Due to missing observations @ if jjj == 16;y = y[2:rows(data)];endif; if jjj == 20;y = y[2:rows(data)];endif; if jjj == 11;y = y[1:rows(data)-1];endif; if jjj == 14;y = y[1:rows(data)-1];endif; if jjj == 18;y = y[1:rows(data)-1];endif; if jjj == 19;y = y[2:rows(data)-1];endif; format /m1/rd 20,0 ; ""; ""; "|========>";; "Series (not logged) : "$name[jjj,1]; ""; n = rows(y); format /m1/rd 5,0; "# of obs = " n;*/@ ================================================================ @ load data[38,21] = gdp.txt; npanel = 20; @ # of panels @ let name = YearAustraliaAustriaBelgiumCanadaDenmarkFinlandFrance GermanyGreeceIcelandIrelandItalyJapanNetherlandsNorway SpainSwedenSwitzerlandUKUSA; data = ln(data); Timedum = 0; Do while Timedum <= 1; "";"";""; "======================================="; " Time Dummy (1=yes, 0=no) : " timedum; "======================================="; jjj = 2; do while jjj <= cols(data); y = data[.,jjj]; format /m1/rd 20,0 ; ""; ""; "|========>";; "Series : "$name[jjj]; ""; n = rows(y); format /m1/rd 5,0; "# of obs = " n; if cols(data) == npanel;mmm = jjj; fstcol = 0; elseif cols(data) == npanel+1;mmm = jjj-1; fstcol = 1; else; "Error in # of panels !!!";stop;endif; format /m1/rd 6,4; "Panel # = ";; mmm;""; @ To control cross-country time effect @ if timedum == 1; if fstcol == 0; newdata = data - meanc(data'); else; tt1 = meanc(data[.,2:cols(data)]'); newdata = data[.,2:cols(data)] - tt1; endif; y = newdata[.,mmm]; endif; @ ================================================================ @/* End of Options */ @ imodel1 = Crash model (dummy on the intercepts) 2 = Breaking trend (dummy on the trend) @ imodel=1; do while imodel <= 2; @ once for each model for the panel test @ cls; "---------------------------------------------------"; "Lee and Strazicich Min LM t-stat with ONE break "; "Model = " imodel; T = n; T1 = round(T1_end * rows(y)); T2 = round(T2_end * rows(y)); if T1 < maxk+2; T1 = maxk + 3;endif; @ any big value @ minlm = 1000; lmestd1 = zeros(T,1); lmtd1 = zeros(T,1); lmlm1 = zeros(T,1); lmtk1 = zeros(T,1); lmoptk1 = zeros(T,1);ii = T1;Do while ii <= T2; output off; format /rd/m1 5,0; Estconf = ii; locate 5,1; Estconf'; lmtk = zeros(maxk+1,1); lmlm = zeros(maxk+1,1); lmestd = zeros(maxk+1,1); lmtd = zeros(maxk+1,1); kk = 0;@ lag @ do while kk <= maxk; If imodel == 1; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMk(y, EstConf,kk,0); Endif; If imodel == 2; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, EstConf,kk,0); Endif; lmlm[kk+1] = lmtstat; if kk > 0; lmtk[kk] = lmtval[kk+1];endif; @ t-stat of the coeff. of the last augmented term @ kk = kk + 1; endo; jj = maxk;isw = 0; do while isw ne 1; if (abs(lmtk[jj]) > crit_t) or (jj == 0); lmoptk = jj;isw = 1; endif; jj = jj - 1; endo; tt = lmoptk+1; lm_k = lmlm[tt]; if lm_k < minlm; minlm = lm_k; lmtb = Estconf; lmk = lmoptk; format /rd/m1 5,0; locate 9,10; "Updated break = ";; Estconf;; " lag = ";; lmk; endif;ii = ii + 1; Endo; output on; optb = lmtb; optk = lmk; format /rd/m1 10,4; "----------------------------------------------------"; ""; "Model(1=A, 2=C) = " imodel; If imodel == 1; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMk(y, optb, optk, 0); Endif; If imodel == 2; {lmtstat, lmed, lmtd0, lmres, lmbeta, lmtval, lmsig} = nLMCk(y, optb, optk, 0); Endif; panel_t[mmm] = lmtstat; panel_k[mmm] = optk; panel_b[mmm] = optb; ""; "Min. test statistic = "lmtstat; "Estimated break point= "optb; "Selected lag = "optk; ""; "Est. coeff. of dummy = "lmed; "Its t-stat = "lmtd0; "Standard error .. = "lmsig; @"Standardized dummy = "lmed / lmsig;@ if imodel == 1; ""; "Coeff and t-stat"; "Z(t) = [S(t-1), (lags..omitted), 1, B1(t)] "; endif; if imodel == 2; ""; "Coeff and t-stat"; "Z(t) = [S(t-1), (lags..omitted), 1, B1(t), D1(t)] "; endif; tt1 = lmbeta[1] | lmbeta[2+optk:rows(lmbeta)]; tt2 = lmtval[1] | lmtval[2+optk:rows(lmtval)]; tt3 = tt1 ~ tt2; tt3; "";下面的应该不用改了,长度有限。
「经管之家」APP:经管人学习、答疑、交友,就上经管之家!
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
本文关键词:

本文论坛网址:https://bbs.pinggu.org/thread-1447499-1-1.html

人气文章

1.凡人大经济论坛-经管之家转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
数据分析师 人大经济论坛 大学 专业 手机版
联系客服
值班时间:工作日(9:00--18:00)