# [R] How are the coefficients for the ur.ers, type DF-GLS calculated?

ackbar03 wdai03 at gmail.com
Wed Feb 29 17:20:29 CET 2012

```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.

```