Re: [R] Access values in kpssstat-class

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Fri 14 Jul 2006 - 01:56:57 EST

          Have you tried 'str(test)'? This tells me it is "Formal class 'kpssstat' [package "uroot"] with 5 slots". I can access the slot 'ltrunc' and the component 'rank' of the 'lmkpss' slot as follows:

 > test@ltrunc
[1] 7
 > test@lmkpss$rank
[1] 2

	  Hope this helps.
	  Spencer Graves

p.s. I'm not familiar with the 'KPSS.test'. I used RSiteSearch("KPSS.test", "functions") to find it was in package 'uroot'.

Sachin J wrote:
> Hi,
>
> How can I access the Values stored in kpssstat-class given by KPSS.test function and store it in a variable.
>
> For example:
>
> >x <- rnorm(1000)
> >test <- KPSS.test(ts(x))
> >test
> ---- ----
> KPSS test
> ---- ----
> Null hypotheses: Level stationarity and stationarity around a linear trend.
> Alternative hypothesis: Unit root.
> ----
> Statistic for the null hypothesis of
> level stationarity: 0.138
> Critical values:
> 0.10 0.05 0.025 0.01
> 0.347 0.463 0.574 0.739
> ----
> Statistic for the null hypothesis of
> trend stationarity: 0.038
> Critical values:
> 0.10 0.05 0.025 0.01
> 0.119 0.146 0.176 0.216
> ----
> Lag truncation parameter: 7
>
> then store the test stat values in some variable say - result
>
> Thanx in advance.
>
>
>
>
> ---------------------------------
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 14 02:00:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 14 Jul 2006 - 04:14:27 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.