I need some real help on this, really stuck
how are the coefficients for ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), lag.max = 0) The max lag is set at zero, so the regression should simply be Diff(zt) = a*z(t-1) where a is the value i'm trying to find and z(t)'s are the detrended values. but through performing my own regression on the two time series I get different values. This could only mean 1) Its not just a simple regression or 2) I'm detrending my data incorrectly. However, i've followed the instructions I've seen in research papers and it doesn't seem to be right. Basically I take Y*t = Yt-(1-(1-7/T)*Y(t-1) and regress that on 1-(1-7/T) for all t>1 and leave the values at T=1 unchanged. Then I take Yt and subtract the coefficient of the regression to get the detrended value. I'm really stuck on this and its really frustrating. I think the easiest thing would be if someone can tell me exactly how R carries out the calculations for the functions. Help will be highly appreciated!! |
Simply type ur.ers on a line by itself to see how the calculation is
implemented. Michael On Wed, Feb 29, 2012 at 11:20 AM, ackbar03 <[hidden email]> wrote: > I need some real help on this, really stuck > > how are the coefficients for > ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), > lag.max = 0) > > The max lag is set at zero, so the regression should simply be > > Diff(zt) = a*z(t-1) > > where a is the value i'm trying to find and z(t)'s are the detrended values. > but through performing my own regression on the two time series I get > different values. This could only mean > > 1) Its not just a simple regression > or > 2) I'm detrending my data incorrectly. > > However, i've followed the instructions I've seen in research papers and it > doesn't seem to be right. Basically I take Y*t = Yt-(1-(1-7/T)*Y(t-1) and > regress that on 1-(1-7/T) for all t>1 and leave the values at T=1 > unchanged. Then I take Yt and subtract the coefficient of the regression to > get the detrended value. > > I'm really stuck on this and its really frustrating. I think the easiest > thing would be if someone can tell me exactly how R carries out the > calculations for the functions. Help will be highly appreciated!! > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-are-the-coefficients-for-the-ur-ers-type-DF-GLS-calculated-tp4432015p4432015.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
In reply to this post by ackbar03
Ackbar:
have a look at ur.ers directly. The coefficients can be recovered from the slot 'testreg', i.e., example(ur.ers) slotNames(ers.gnp) coef(ers.gnp@testreg) RTFM: help("ur.ers") and help("ur.ers-class") Best, Bernhard -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von ackbar03 Gesendet: Mittwoch, 29. Februar 2012 17:20 An: [hidden email] Betreff: [R] How are the coefficients for the ur.ers, type DF-GLS calculated? I need some real help on this, really stuck how are the coefficients for ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), lag.max = 0) The max lag is set at zero, so the regression should simply be Diff(zt) = a*z(t-1) where a is the value i'm trying to find and z(t)'s are the detrended values. but through performing my own regression on the two time series I get different values. This could only mean 1) Its not just a simple regression or 2) I'm detrending my data incorrectly. However, i've followed the instructions I've seen in research papers and it doesn't seem to be right. Basically I take Y*t = Yt-(1-(1-7/T)*Y(t-1) and regress that on 1-(1-7/T) for all t>1 and leave the values at T=1 unchanged. Then I take Yt and subtract the coefficient of the regression to get the detrended value. I'm really stuck on this and its really frustrating. I think the easiest thing would be if someone can tell me exactly how R carries out the calculations for the functions. Help will be highly appreciated!! -- View this message in context: http://r.789695.n4.nabble.com/How-are-the-coefficients-for-the-ur-ers-type-DF-GLS-calculated-tp4432015p4432015.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ***************************************************************** Confidentiality Note: The information contained in this ...{{dropped:10}} ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
Free forum by Nabble | Edit this page |