Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: how to obtain demeaned data and detrended data in Stata


From   Jan Bryla <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: how to obtain demeaned data and detrended data in Stata
Date   Wed, 19 Oct 2011 14:03:14 +0200

Ama,
Demeaning the variable "var" by variable "id" can be done as follows (it this is indeed what you mean by demeaning)

egen mean_var = mean(var), by(id)
generate demeaned_var = var- mean_var

If you have multiple variables this may help you http://www.stata.com/statalist/archive/2010-09/msg00673.html

See -help egen-

Regarding your detrending question, I guess many people work with the Hodrick-Prescott filter, which is implementet in Stata as an ado-file from SSC. See -findit hprescott-

Maybe this neat presentation will help you http://www.stata.com/meeting/5nasug/TSFiltering_beamer.pdf
 
Christopher F Baum, 2004.
"HPRESCOTT: Stata module to implement Hodrick-Prescott filter for timeseries data," Statistical Software Components
S447001, Boston College Department of Economics, revised 28 Oct 2009.

Hope this helps
Jan Bryla




-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of amatoallah ouchen
Sent: 19. oktober 2011 13:16
To: [email protected]
Subject: st: how to obtain demeaned data and detrended data in Stata

Good day Stata Listers,
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?
Many thanks in advance.

Ama

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index