I would like to run KSS test (KAPETANIOS, G. – SHIN, Y. – SNELL, A. 2003: Testing for a UnitRoot in the Nonlinear STAR Framework) , but I don't know how to obtain demeaned data and detrended data. Could you describe me the process in STATA?
You can demean a variable as follows:
If you have a batch of variables, you can use a loop. Suppose that you have three variables called peter, paul and mary:
If you have missing values and you want to use the variables in a regression, you might want to do listwise deletion. This means that you don't take into account obsevrations that have missings for any of the variables.
For detrending you have several possibilities. If you want to remove a linear trend from a variable y, you could do the following, supposing that t is the time index:
You can also have a look at
as well as the following presentation: http://ideas.repec.org/p/boc/asug06/2.html