[R] can test the if relationship is significant in cancor?
Kjetil Brinchmann Halvorsen
kjetil at acelerate.com
Sat Apr 16 15:44:33 CEST 2005
ronggui wrote:
>i have try hard to find the answer by google,but i can not find any solution.
>so i wan to ask:
>1,can we test the if canonical relationship is significant after using cancor?
>
>
One reference is T. W. Anderson: "An Introduction to Multivariate
Statistical Analysis", second edition, pages 497-498.
>2,if it can,how?
>
>
Following the reference above:
cancor.test <- function(obj, N){
# obj is object returned from cancor
# N is sample size, which is not contained in the cancor object!
p1 <- NROW(obj$xcoef)
p2 <- NROW(obj$ycoef)
p <- p1 + p2
r <- length(obj$cor)
# Calculating Bartlett modification of minus twice log likelihood:
bartlett <- -(N-0.5*(p+3))*sum( log( 1-obj$cor^2))
# which is approximately chi-squared with p1p2 degrees of freedom:
list(bartlett=bartlett, p.value=pchisq(bartlett, df=p1*p2,
lower.tail=FALSE))
}
This tests if ALLl the canonical correlations are zero. Anybody knows
how good this approximation is,
and how dependent on multivariate normality?
Kjetil
>3,if not,is it under-developed or there is not need to do it?or there is no good way to do it?
>
>i hope my question is not too silly.
>
>______________________________________________
>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
>
>
>
>
>
--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
-- Mahdi Elmandjra
More information about the R-help
mailing list