An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110124/104256fc/attachment.pl>
Problem with factor analysis
3 messages · Simon Hayward, Mark Difford, Juliet Hannah
Does anyone know what I am doing wrong?
Could be a lot or could be a little, but we have to guess, because you haven't given us the important information. That you are following Crawley is of little or no interest. We need to know what _you_ did. What is "model" and what's in it? ## str(model) attributes(model) If you fitted your model using factanal then loadings(model)[,1] will fail with the following error message ##
loadings(factanal(m1, factors=3)[,1])
Error in factanal(m1, factors = 3)[, 1] : incorrect number of dimensions Even if you did not see such a message it seems likely that "model" is in the wrong format for loadings to extract anything useful from it. Regards, Mark.
View this message in context: http://r.789695.n4.nabble.com/Problem-with-factor-analysis-tp3234117p3234334.html Sent from the R help mailing list archive at Nabble.com.
3 days later
It looks like the text didn't show assigning the results of factanal
to an object. Try:
pgdata<-read.table("pgfull.txt",header=T)
names(pgdata)
pgd<-pgdata[,1:54]
#missing line
model <- factanal(pgd,8)
par(mfrow=c(2,2))
plot(loadings(model)[,1],loadings(model)[,2],pch=16,xlab="Factor
1",ylab="Factor 2")
plot(loadings(model)[,1],loadings(model)[,3],pch=16,xlab="Factor
1",ylab="Factor 3")
plot(loadings(model)[,1],loadings(model)[,4],pch=16,xlab="Factor
1",ylab="Factor 4")
plot(loadings(model)[,1],loadings(model)[,5],pch=16,xlab="Factor
1",ylab="Factor 5")
On Mon, Jan 24, 2011 at 7:03 AM, Simon Hayward
<SHayward at agenda21digital.com> wrote:
Hi all, I am using the example on page 737 of "The R Book" by Michael J Crawley, to plot factor loadings against each other (in a multivariate analysis). However the following line code plot(loadings(model)[,1],loadings(model)[,2],pch=16,xlab="Factor 1", ylab="Factor 2") throws an error message "Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 3: In min(x) : no non-missing arguments to min; returning Inf 4: In max(x) : no non-missing arguments to max; returning -Inf" I have tried putting in values for the x and y limits, but even then no points appear in my plots. Does anyone know what I am doing wrong? Grateful for any help. Simon Hayward ? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at 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.