# Extracting Factor Pattern Matrix Similar to Proc Factor

6 messages
Open this post in threaded view
|

## Extracting Factor Pattern Matrix Similar to Proc Factor

 Hello, I am fairly new to R and coming from SAS IML. I am rewriting one of my MC simulations in R and am stuck on extracting a factor pattern matrix as would be done in IML using Proc Factor.   I have found the princomp() command and read through the manual but can't seem to figure out how to save the factor pattern matrix.  I am waiting for the R for SAS Users book to arrive. What I would use in SAS IML to get at what I am looking for is: PROC FACTOR Data=MODELCOV15(TYPE=COV) NOBS=10000 N=16 CORR OUTSTAT=FAC.FACOUT15; RUN; DATA FAC.PATTERN15; SET FAC.FACOUT15; IF _TYPE_='PATTERN'; DROP _TYPE_ _NAME_; RUN; Would any SAS IML to R converts be able to help me with this? Thanks, Scott Colwell, PhD
Open this post in threaded view
|

## Re: Extracting Factor Pattern Matrix Similar to Proc Factor

Open this post in threaded view
|

## Re: Extracting Factor Pattern Matrix Similar to Proc Factor

 Thanks David. What do you do when the input is a covariance matrix rather than a dataset?
Open this post in threaded view
|

## Re: Extracting Factor Pattern Matrix Similar to Proc Factor

 Function principal() in psych takes a correlation matrix so use cov2cor() to convert: library(psych) iris.pca <- principal(cov2cor(cov(iris[,-5])), nfactors=4, rotate="none") print(iris.pca\$Structure, cutoff=0) David -----Original Message----- From: R-help [mailto:[hidden email]] On Behalf Of Scott Colwell Sent: Monday, February 23, 2015 3:34 PM To: [hidden email] Subject: Re: [R] Extracting Factor Pattern Matrix Similar to Proc Factor Thanks David. What do you do when the input is a covariance matrix rather than a dataset? -- View this message in context: http://r.789695.n4.nabble.com/Extracting-Factor-Pattern-Matrix-Similar-to-Proc-Factor-tp4703704p4703719.htmlSent from the R help mailing list archive at Nabble.com. ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.