[R] factanal
Lucke, Joseph F
Joseph.F.Lucke at uth.tmc.edu
Mon May 14 17:00:44 CEST 2007
The 2-factor model is under-identified with only 3 variables. The 3
variables provide six statistics (3-variances and 3 covariances) for 6
df. The 2-factor model is trying to fit 9 parameters (3 loadings on
each of 2 factors plus 3 residual variances.) for 9 df. It cannot be
done.
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of
Bill.Venables at csiro.au
Sent: Sunday, May 13, 2007 6:50 PM
To: soarealin at gmail.com; R-help at stat.math.ethz.ch
Subject: Re: [R] factanal
Soare Marcian-Alin asks
> Sent: Monday, 14 May 2007 7:34 AM
> To: R-help at stat.math.ethz.ch
> Subject: [R] factanal
>
> Hello Guys,
... and the gals, I presume.
> I have problem with the factanal function, I dont understand why it
tells me
> everytime "2 factors is too many for 3 variables"
It's because the 'x' argument to factanal is supposed to be the matrix
of responses, and not something derived from it as you use below.
> data set:
>
http://www.statistik.tuwien.ac.at/public/filz/students/multi/ss07/world2
.R
>
> code:
> library(robustbase)
>
> source("world2.R")
>
> str(world) # structure
> summary(world)
>
> world[,8] <- log(world[,8])
> world[,9] <- log(world[,9])
> x <- world[,-c(1,2)]
> x = scale(x)
> princomp(x, cor=TRUE)
> summary(princomp(x, cor=TRUE)) # First Three Main Components:
0.8687063
>
> #a) paarweise Biplots
> biplot(princomp(x, cor=TRUE))
> biplot(princomp(x, cor=TRUE), choices=c(1:2)) biplot(princomp(x,
> cor=TRUE), choices=c(1:3)) biplot(princomp(x, cor=TRUE),
> choices=c(2:3))
>
> #b) varimax
> x.loa <- loadings(princomp(x, cor=TRUE))
> varimax(x.loa[,1:3])
> varimax(x.loa[,1:3])$rotmat
> rotmat <- varimax(x.loa[,1:3])$rotmat
> biplot(princomp(rotmat, cor=TRUE), choices=c(1:2))
> biplot(princomp(rotmat, cor=TRUE), choices=c(1:3))
> biplot(princomp(rotmat, cor=TRUE), choices=c(2:3))
>
> #c) factor-analysis
> factanal(rotmat, factors=2) ## ?????
how about using
factanal(x, factors = 2)
### ?
>
> Thanks in advance.
>
> KR,
> Alin Soare
>
> [[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
> and provide commented, minimal, self-contained, reproducible code.
>
______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list