# How to extract p-value from ur.df package of urca in R? [closed]

I want to extract the p-value from the below output. How do i get it?

library(urca)

data(Raotbl3)

attach(Raotbl3)

lc.df <- ur.df(y=lc, lags=3, type='trend')

summary(lc.df)


## Output:

Using dput() you can inspect an R object, e.g.
dput(lc.df)

Using that I found that the p-values are stored in an attribute 'testreg' which turns out to be a list with class summary.lm (again with dput()). The coefficient table is in coefficients so getting the p-values is easy enough:
attr(lc.df, 'testreg')$coefficients[,4]  It's not unlikely that urca has a convenience method for this too. Admittedly, finding the p-value of the whole test is a bit more tricky, the p-value is calculated on the fly as 1 - pf(3.07132302249161, 5, 89)  These values can be extracted from the object. • Im not able to fetch the p-value with the above code – syed tabrez Aug 19 at 7:29 • > attr(lc.df, 'testreg')$coefficients[,4] (Intercept) z.lag.1 tt z.diff.lag1 z.diff.lag2 z.diff.lag3 0.027024311 0.027658041 0.025174790 0.293449348 0.050021177 0.004203314 – syed tabrez Aug 19 at 7:30
• Those are the same values as you show in the right column of your table? In any case, using dput() you should be able to be able to figure out how to get any value from that table. – Bob Jansen Aug 19 at 7:33