Questions tagged [factor-analysis]

221 questions
13
votes
1 answer

Venn diagram from list of clusters and co-occurring factors

I've got an input file with a list of ~50000 clusters and presence of a number of factors in each of them (~10 million entries in total), see a smaller example below: set.seed(1) x = paste("cluster-",sample(c(1:100),500,replace=TRUE),sep="") y = c( …
719016
  • 9,922
  • 20
  • 85
  • 158
12
votes
1 answer

How to perform a Direct Oblimin Rotation in MATLAB

I'm trying to perform the following analysis in MATLAB: Direct Oblimin Rotation with a Delta value of 0 and "Kaiser Normalization" I know that MATLAB has a function called rotatefactors, however oblimin rotation is not mentioned (neither "Kaiser…
mat
  • 2,412
  • 5
  • 31
  • 69
12
votes
1 answer

factor analysis using R

Im trying to do a factor analysis using R with varimax rotation, but not successful. I run the same exact data on SAS and can get result. in R, if I use fa(r=cor(m1), nfactors=8, fm="ml", rotate="varimax") I will get In smc, the correlation matrix…
user1940902
  • 121
  • 1
  • 1
  • 6
12
votes
4 answers

psych - Getting factor loadings as data.frame for LaTeX export

I am using the psych package's fa command for factor analysis, and so have an object of class fa. I can query the loadings with fac$loadings, but I want to only extract the table containing the loadings, so I can use xtable (or similar) to convert…
bountiful
  • 814
  • 1
  • 8
  • 22
9
votes
2 answers

Rotation in 'FactoMineR' package

Thanks in advance. I've used the 'PCA' function from the 'FactoMineR' package to obtain principal component scores. I've tried reading through the package details and similar questions on this forum but can't figure out the code to rotate the…
gtnbz2nyt
  • 1,465
  • 3
  • 17
  • 33
8
votes
0 answers

Dimensionality reduction, noralization, resampling, k-fold CV... In what order?

In Python I am working on a binary classification problem of Fraud detection on travel insurance. Here is the characteristic about my dataset: Contains 40,000 samples with 20 features. After one hot encoding, the number of features is 50(4 numeric,…
8
votes
2 answers

Factor Analysis in sklearn: Explained Variance

PCA in scikit-learn has an attribute called "explained_variance" which captures the variance explained by each component. I don't see a similar thing like this for FactorAnalysis in scikit-learn. How can I compute the variance explained by each…
vkmv
  • 1,345
  • 1
  • 14
  • 24
8
votes
2 answers

How to calculate FactorAnalysis scores using Python (scikit-learn)?

I need to perform exploratory factor analysis and calculate scores for each observation using Python assuming that there is only 1 underlying factor. It seems that sklearn.decomposition.FactorAnalysis() is the way to go, but unfortunately…
SS_Rebelious
  • 1,274
  • 2
  • 19
  • 35
7
votes
2 answers

Error in Factor Analysis - Starting Values

I have a n = 1008 x p = 45 data matrix and I am trying to perform a factor analysis in the data, using the factanal() function. I am getting the same error regardless of the number of factors that I decide to fit: "Error in factanal(rios, 3,…
Mushrambo
  • 133
  • 3
  • 8
7
votes
2 answers

Rotation argument for scikit-learn's factor analysis

One of the hallmarks of factor analysis is that it allows for non-orthogonal latent variables. In R for example this feature is accessible via the rotation parameter of factanal. Is there any such provision for sklearn.decomposition.FactorAnalysis?…
TheChymera
  • 17,004
  • 14
  • 56
  • 86
4
votes
1 answer

Calculating goodness of fit and rmsea from factor_analyser in python

I am performing Confirmatory factor analysis in python using the factor_analyzer module. I have searched hi and low for a way to generate the model diagnostics such as the Root Mean Square Error of Approximation, the chi square, the CFI and…
KevOMalley743
  • 551
  • 3
  • 20
4
votes
2 answers

Getting data frame from loadings of factor analysis (fa function in psych)

I have a data frame such as follows: x <- c(1, 2, 1, 2) y <- c(1, 2, 3, 4) z <- c(4, 3, 2, 1) df <- data.frame(x, y, z) I am running a factor analysis with the fa funciton from the psych package: fit <- fa(df, nfactors = 2) fit$loadings This…
Marco Pastor Mayo
  • 803
  • 11
  • 25
4
votes
2 answers

CFA in R (lavaan) with ordinal data - polychoric correlation included?

I would like to compute a confirmatory factor analysis (CFA) with ordinal data in R using lavaan. The data is from a questionnaire, containing 16 items structured on a Likert-scale. I assume a 4-factor-model to be the best fit to my data. To…
user6899059
4
votes
1 answer

Reproducing SPSS factor analysis with R

I'm hoping someone can point me in the right direction. First of all, I am not a statistician. I am a software developer that has been given the task of trying to reproduce the results of SPSS's factor analysis (using PC extraction & varimax…
3
votes
1 answer

Difference between fit$loadings and fit$Vaccounted for variance accounted for in factor analysis?

I am getting different values for variance accounted for by factors in factor analysis whether I check them with fit$loadings or with fit$Vaccounted. I am using the psych package with the fa() function. Why would that be the case if they're supposed…
rempsyc
  • 785
  • 5
  • 24
1
2 3
14 15