Hi All,
How do i calculate KMO for a dataset?

*Dataset:---------------------*

    m1 m2 m3 m4 m5 m6 m7 m8
1       2 20 20  2  1  4 14 12
2       9 16  3  5  2  5  5 15
3      18 18 18 13 17  9  2  4
4       7  7  2 12  2 11 11 11
5       7  8  5 19  5  2 20 18
6       7  4  7  4  7  9  3  3
7       5  5  5 12  5 13 13 12
8       6  6  4  3  5 17 17 16
9      12 12  4  2  4  4 14 14
10      5 14  6 19  6  2 20 20
11     13 13 13 20 10 10 10  9
12      3  3  3 11  6 15 15 12
13      2  2  2  7  5  5  6 16
14     11 11 10  4 10 10 10 10
15      1  1  1  8  4 16 16 17
16     23 23  3  4  3  3  3  3
17      4  4  6  9  8 17  8 18
18      8  8  5  9  7  7  7  9
19      6  7  8  3  8  4  4  7
20      8 11  9  3  2  2  2  3

**
*SPSS results for the above dataset:--------*

Kaiser-Meyer-Olkin Measure of Sampling Adequacy.(KMO)
0.350911931549742

*Got a R-function:-----* (
http://www.opensubscriber.com/message/r-h...@stat.math.ethz.ch/2776549.html)
kmo.test <- function(df){
###
## Calculate the Kaiser-Meyer-Olkin Measure of Sampling Adequacy.
## Input should be a data frame or matrix, output is the KMO statistic.
## Formula derived from Hutcheson et al, 1999,
## "The multivariate social scientist," page 224, ISBN 0761952012
## see 
<http://www2.chass.ncsu.edu/garson/pa765/hutcheson.htm><http://www2.chass.ncsu.edu/garson/pa765/hutcheson.htm%3E>
###
cor.sq = cor(df)^2
cor.sumsq = (sum(cor.sq)-dim(cor.sq)[1])/2
library(corpcor)
pcor.sq = cor2pcor(cor(df))^2
pcor.sumsq = (sum(pcor.sq)-dim(pcor.sq)[1])/2
kmo = sus.cor.ss/(sus.cor.ss+sus.pcor.ss)
return(kmo)
}

What is this object "*sus.cor.ss*"?I get errors
> sus.cor.ss
Error: object "sus.cor.ss" not found


Thanks in advance
Moumita

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to