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

3 messages
Open this post in threaded view
|

## 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!!