An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20030508/674d4482/attachment.pl
Returning the p-value of a factor analysis
4 messages · Wayne Jones, Brian Ripley, Peter Dalgaard
On Thu, 8 May 2003, Wayne Jones wrote:
Does anyone know how to explicitly refer to the p-value of thet test that the chosen number of factors is significant in a factor analysis. It's not in the list of values for the factanal command output yet it is printed out with the results.
Right, so look at the code to compute it in print.factanal and write a
small function to extract the value you want from the object.
Something like
Pval.factanal <- function(x)
{
p <- nrow(x$loadings); factors <- x$factors
if(!is.na(x$n.obs) && x$dof > 0) {
dof <- x$dof
stat <- (x$n.obs - 1 - (2 * p + 5)/6 -
(2 * factors)/3) * x$criteria["objective"]
pchisq(stat, dof, lower.tail = FALSE)
} else NA
}
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Wayne Jones <JonesW at kssg.com> writes:
Hi there, Does anyone know how to explicitly refer to the p-value of thet test that the chosen number of factors is significant in a factor analysis. It's not in the list of values for the factanal command output yet it is printed out with the results. Thanks in advance.
It's calculated when printed. This is somewhat in bad style (according
to my tastes at least), but we have that happening in a few places. So
you need to redo the computations, which can be found inside
print.factanal. In 1.7.0, this function is hidden in the mva namespace
but you can view it with get("print.factanal",environment(factanal)).
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> writes:
In 1.7.0, this function is hidden in the mva namespace
but you can view it with get("print.factanal",environment(factanal)).
On closer thought, that should probably be
getS3method("print","factanal")
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907