ackbar03
2012-Feb-29 16:20 UTC
[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.
R. Michael Weylandt
2012-Mar-01 04:08 UTC
[R] How are the coefficients for the ur.ers, type DF-GLS calculated?
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 <wdai03 at gmail.com> 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. > > ______________________________________________ > R-help at r-project.org 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.
Pfaff, Bernhard Dr.
2012-Mar-01 10:07 UTC
[R] How are the coefficients for the ur.ers, type DF-GLS calculated?
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 at testreg) RTFM: help("ur.ers") and help("ur.ers-class") Best, Bernhard -----Urspr?ngliche Nachricht----- Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von ackbar03 Gesendet: Mittwoch, 29. Februar 2012 17:20 An: r-help at r-project.org 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. ______________________________________________ R-help at r-project.org 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}}