[R] Access values in kpssstat-class

Spencer Graves spencer.graves at pdf.com
Thu Jul 13 17:56:57 CEST 2006


	  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 at ltrunc
[1] 7
 > test at 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 at 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



More information about the R-help mailing list