Thank you for your help!

I am following the example in the "vars" package in R, shown below:

data(denmark)
sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")]
sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun",
season=4)
summary(sjd.vecm)

I got the following stats:

> sjd.vecm@teststat
[1]  2.352233  6.342730 10.361950 30.087451
> sjd.vecm@cval
         10pct  5pct  1pct
r <= 3 |  7.52  9.24 12.97
r <= 2 | 13.75 15.67 20.20
r <= 1 | 19.77 22.00 26.81
r = 0  | 25.56 28.14 33.24


How shall I draw a conclusion of "pass/fail" automatically and
programmatically?

Could you please show me using the above example?

Thank you!


On Fri, Mar 30, 2012 at 11:08 AM, R. Michael Weylandt <
michael.weylandt@gmail.com> wrote:

> Actually, it looks like ca.jo objects are S4 so it's a little bit
> harder: take a look at ?`ca.jo-class` (note the backticks) to see the
> 26 slots available. I'm not sure if the ones you want have dedicated
> extractor methods but you can get them with ?slot directly. There's
> not an absolute pass/fail (like most other statistical tests) so you
> have to pick your desired significance threshold, but that's not hard.
> As Brian said though, it makes most sense to do this inside your loop
> construction.
>
> Hope this helps,
>
> Michael Weylandt
>
> On Fri, Mar 30, 2012 at 12:00 PM, Brian G. Peterson <brian@braverock.com>
> wrote:
> > On Fri, 2012-03-30 at 10:53 -0500, Michael wrote:
> >> How to automatically extract test result from Johansen test?
> >>
> >> Hi all,
> >>
> >> I am using the "ca.jo" function to do the Johansen test.
> >>
> >> It's outputting a lot of results.
> >>
> >> If I am running this on a large number of assets, is there a way to
> >> automatically extract and condense the test outputs to just "pass/fail"
> and
> >> "residuals"?
> >>
> >> Thanks a lot!
> >
> > Like all R objects, it is a list internally. Extract what you need in
> > the same loop that's doing the test.
> >
> > Please at least try before posting.
> >
> > --
> > Brian G. Peterson
> > http://braverock.com/brian/
> > Ph: 773-459-4973
> > IM: bgpbraverock
> >
> > _______________________________________________
> > R-SIG-Finance@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only. If you want to post, subscribe first.
> > -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

