[R] incomplete function output
bogdan romocea
br44114 at yahoo.com
Wed Oct 13 19:19:56 CEST 2004
Dear R users,
I have a function (below) which encompasses several tests.
However, when I run it, only the output of the last test is
displayed. How can I ensure that the function root(var)
will run and display the output from all tests, and not
just the last one?
Thank you,
b.
root <- function(var)
{
#---Phillips-Perron
PP.test(var, lshort = TRUE)
PP.test(var, lshort = FALSE)
#---Augmented Dickey-Fuller
adf.test(var, alternative = "stationary", k =
trunc((length(var)-1)^(1/3)))
#---KPSS
kpss.test(var, null = "Level", lshort = TRUE)
kpss.test(var, null = "Trend", lshort = FALSE)
}
More information about the R-help
mailing list