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)
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It only takes a minute to sign up.Sign up to join this community
dput() you can inspect an R object, e.g.
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:
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.