Teste Kpss

1 view
Skip to first unread message

Lara Preece

unread,
Aug 5, 2024, 12:10:00 AM8/5/24
to azesenaw
Mustbe invoked after an estimation command. Performs a jointtest for the addition of the specified variables to the lastmodel, the results of which may be retrieved using theaccessors $test and $pvalue.

By default an augmented version of the original model isestimated, including the variables in varlist.The test is a Wald test on the augmented model, which replacesthe original as the "current model" for thepurposes of, for example, retrieving the residuals as$uhat or doing further tests.


Alternatively, given the --lm option (availableonly for the models estimated via OLS), an LM test isperformed. An auxiliary regression is run in which thedependent variable is the residual from the last model and theindependent variables are those from the last model plusvarlist. Under the null hypothesis that the addedvariables have no additional explanatory power, the samplesize times the unadjusted R-squared from this regression isdistributed as chi-square with degrees of freedom equal to thenumber of added regressors. In this case the original model isnot replaced.


The --both option is specific to two-stageleast squares: it specifies that the new variablesshould be added both to the list of regressors and thelist of instruments, the default in this case being toadd to the regressors only.


The options shown above and the discussion which followsmostly pertain to the use of the adf command withregular time series data. For use of this command with paneldata please see the section titled "Panel data"below.


By default, two variants of the test are shown: one based on aregression containing a constant and one using a constant andlinear trend. You can control the variants that are presented byspecifying one or more of the option flags --nc,--c, --ct, --ctt.


In all cases the dependent variable in the test regression isthe first difference of the specified series, y,and the key independent variable is the first lag ofy. The regression is constructed such that thecoefficient on lagged y equals the root inquestion, α, minus 1. For example, the model with aconstant may be written as


Under the null hypothesis of a unit root the coefficient onlagged y equals zero. Under the alternative thaty is stationary this coefficient is negative. Sothe test is inherently one-sided.


When testing down via AIC or BIC, the final lag order for theADF equation is that which optimizes the chosen informationcriterion (Akaike or Schwarz Bayesian). The exact proceduredepends on whether or not the --gls option isgiven. When GLS is specified, AIC and BIC are the"modified" versions described in Ng and Perron (2001), otherwise theyare the standard versions. In the GLS case a refinement isavailable. If the additional option --perron-qu isgiven, lag-order selection is performed via the revised methodrecommended by Perron and Qu(2007). In this case the data are first demeaned ordetrended via OLS; GLS is applied once the lag order isdetermined.


First, while you may give a list of variables for testing inthe regular time-series case, with panel data only onevariable may be tested per command. Second, the optionsgoverning the inclusion of deterministic terms become mutuallyexclusive: you must choose between no-constant, constant only,and constant plus trend; the default is constant only. Inaddition, the --seasonals option is not available.Third, the --verbose option has a different meaning:it produces a brief account of the test for each individualtime series (the default being to show only the overallresult).


The overall test (null hypothesis: the series in question hasa unit root for all the panel units) is calculated in one orboth of two ways: using the method of Im,Pesaran and Shin (Journal of Econometrics, 2003) orthat of Choi (Journal of InternationalMoney and Finance, 2001). The Choi test requires thatP-values are available for the individualtests; if this is not the case (depending on the optionsselected) it is omitted. The particular statistic given forthe Im, Pesaran, Shin test varies as follows: if the lag orderfor the test is non-zero their W statistic isshown; otherwise if the time-series lengths differ byindividual, their Z statistic; otherwise theirt-bar statistic. See also the levinlin command.


Analysis of Variance: response is a series measuring someeffect of interest and treatment must be a discretevariable that codes for two or more types of treatment (ornon-treatment). For two-way ANOVA, the block variable(which should also be discrete) codes for the values of some controlvariable.


The null hypothesis for the F-test is that the meanresponse is invariant with respect to the treatment type, or in wordsthat the treatment has no effect. Strictly speaking, the testis valid only if the variance of the response is the same forall treatment types.


Note that the results shown by this command are in fact a subset ofthe information given by the following procedure, which is easilyimplemented in gretl. Create a set of dummy variables coding for allbut one of the treatment types. For two-way ANOVA, in addition createa set of dummies coding for all but one of the "blocks".Then regress response on a constant and the dummies usingols. For a one-way design the ANOVA table is printedvia the --anova option to ols. In the two-waycase the relevant F-test is found by using the omit command. For example (assuming y is theresponse, xt codes for the treatment, and xbcodes for blocks):


Opens a data file and appends the content to the currentdataset, if the new data are compatible. The program will tryto detect the format of the data file (native, plain text,CSV, Gnumeric, Excel, etc.). Please note that the join command offers much more control over thematching of supplementary data to the current dataset. Alsonote that appending data to an existing panel dataset ispotentially quite tricky; see the section headed "Paneldata" below.


The appended data may take the form of either additionalobservations on series already present in the dataset, and/ornew series. In the case of adding series, compatibilityrequires either (a) that the number of observations for thenew data equals that for the current data, or (b) that the newdata carries clear observation information so that gretl canwork out how to place the values.


One case that is not supported is where the new data startearlier and also end later than the original data. To add newseries in such a case you can use the --fixed-sampleoption; this has the effect of suppressing the adding ofobservations, and so restricting the operation to the additionof new series.


When a data file is selected for appending, there may be anarea of overlap with the existing dataset; that is, one ormore series may have one or more observations in common acrossthe two sources. If the option --update-overlap isgiven, the append operation will replace anyoverlapping observations with the values from the selecteddata file, otherwise the values currently in place will beunaffected.


By default some information about the appended dataset is printed. The --quiet option reduces that printout to a confirmatory message stating just the path to the file. If you want the operation to be completely silent, then issue the command set verbose off before appending the data, in combination with the --quiet option.


Two relatively simple cases should be handled correctly byappend. Let n denote the number ofcross-sectional units and T denote the number oftime periods in the current panel, and let mdenote the number of observations for the new data. Ifm = n the new data are taken to betime-invariant, and are copied into place for each timeperiod. On the other hand, if m = T the data aretreated as invariant across the panel units, and are copiedinto place for each unit. If T = n an ambiguityarises. In that case the new data are treated astime-invariant by default, but you can force gretl to treatthem as time series (invariant across the units) via the--time-series option.


If both the current dataset and the incoming data arerecognized as panel data two cases arise. (1) The time-serieslength, T, differs between the two. Then an erroris flagged. (2) T matches. Then a very simpleassumption is made, namely that the units match up,starting with the first unit in bothdatasets. If that assumption is not correct you must usejoin instead of append.


This command is retained at present for backwardcompatibility, but you are better off using the maximumlikelihood estimator offered by the garchcommand; for a plain ARCH model, set the first GARCHparameter to 0.


Estimates the given model specification allowing for ARCH(Autoregressive Conditional Heteroskedasticity). The model isfirst estimated via OLS, then an auxiliary regression is run, inwhich the squared residual from the first stage is regressed onits own lagged values. The final step is weighted least squaresestimation, using as weights the reciprocals of the fitted errorvariances from the auxiliary regression. (If the predictedvariance of any observation in the auxiliary regression is notpositive, then the corresponding squared residual is usedinstead).


The optional integer values P, D andQ represent the seasonal AR order, the order forseasonal differencing, and the seasonal MA order,respectively. These are applicable only if the data have afrequency greater than 1 (for example, quarterly or monthlydata). These orders may be given in numerical form or asscalar variables.


In the univariate case the default is to include an interceptin the model but this can be suppressed with the--nc flag. If indepvars are added,the model becomes ARMAX; in this case the constant should beincluded explicitly if you want an intercept (as in the secondexample above).


An alternative form of syntax is available for this command:if you do not want to apply differencing (either seasonal ornon-seasonal), you may omit the d andD fields altogether, rather than explicitlyentering 0. In addition, arma is a synonym oralias for arima. Thus for example the followingcommand is a valid way to specify an ARMA(2, 1) model:

3a8082e126
Reply all
Reply to author
Forward
0 new messages