0
$\begingroup$

I would like to create survey response data if possible from a correlation matrix or factor analysis, or any other way if possible. My end goal is to scale up the samples in my data file and run a factor analysis on a survey data set. Its an ordinal scale where respondents are asked to rate attributes of a commercial product. I have attached some code as an example below to work wit as an example:

In the example dataset (bfi from psych package) the sample is 2800, I would like to produce a sample of 10000 if possible.

I have tried to look into the psych package but can not figure out how to do this. I have run a 5 factor solution on the bfi dataset included, se below

library(psych)
load(bfi)
data <- bfi[,c(1:25)]
> head(data)
      A1 A2 A3 A4 A5 C1 C2 C3 C4 C5 E1 E2 E3 E4 E5 N1 N2 N3 N4 N5 O1 O2 O3 O4 O5
61617  2  4  3  4  4  2  3  3  4  4  3  3  3  4  4  3  4  2  2  3  3  6  3  4  3
61618  2  4  5  2  5  5  4  4  3  4  1  1  6  4  3  3  3  3  5  5  4  2  4  3  3
61620  5  4  5  4  4  4  5  4  2  5  2  4  4  4  5  4  5  4  2  3  4  2  5  5  2
61621  4  4  6  5  5  4  4  3  5  5  5  3  4  4  4  2  5  2  4  1  3  3  4  3  5
61622  2  3  3  4  5  4  4  5  3  2  2  2  5  4  5  2  3  4  4  3  3  3  4  3  3
61623  6  6  5  6  5  6  6  6  1  3  2  1  6  5  6  3  5  2  2  3  4  3  5  6  1


f5 <- fa(data,5) #factor analysis

colnames(f5$loadings) <- paste("F",1:5,sep="") Change column names
f5 #output from factor analysis

Factor Analysis using method =  minres
Call: fa(r = bfi[1:25], nfactors = 5)
Standardized loadings (pattern matrix) based upon correlation matrix
      F1    F2    F3    F4    F5   h2   u2 com
A1  0.20  0.04 -0.36 -0.14 -0.04 0.15 0.85 2.0
A2 -0.02  0.09  0.60  0.01  0.03 0.40 0.60 1.1
A3 -0.03  0.03  0.67 -0.07  0.04 0.51 0.49 1.0
A4 -0.06  0.20  0.46 -0.04 -0.15 0.29 0.71 1.7
A5 -0.14  0.00  0.58 -0.17  0.06 0.48 0.52 1.3
C1  0.06  0.53  0.00  0.05  0.16 0.32 0.68 1.2
C2  0.13  0.64  0.11  0.13  0.06 0.43 0.57 1.2
C3  0.04  0.56  0.11  0.08 -0.06 0.32 0.68 1.1
C4  0.12 -0.64  0.06  0.04 -0.03 0.47 0.53 1.1
C5  0.14 -0.57  0.01  0.16  0.10 0.43 0.57 1.4
E1 -0.09  0.10 -0.10  0.56 -0.11 0.37 0.63 1.3
E2  0.06 -0.03 -0.09  0.67 -0.07 0.55 0.45 1.1
E3  0.06 -0.02  0.30 -0.34  0.31 0.44 0.56 3.0
E4  0.00  0.01  0.36 -0.53 -0.05 0.52 0.48 1.8
E5  0.18  0.27  0.08 -0.39  0.22 0.40 0.60 3.1
N1  0.85  0.01 -0.09 -0.09 -0.05 0.71 0.29 1.1
N2  0.82  0.02 -0.08 -0.04  0.01 0.66 0.34 1.0
N3  0.67 -0.06  0.10  0.14  0.03 0.53 0.47 1.2
N4  0.41 -0.16  0.09  0.42  0.08 0.48 0.52 2.4
N5  0.44 -0.02  0.22  0.25 -0.14 0.34 0.66 2.4
O1 -0.01  0.06  0.02 -0.06  0.53 0.32 0.68 1.1
O2  0.16 -0.10  0.21 -0.03 -0.44 0.24 0.76 1.9
O3  0.01  0.00  0.09 -0.10  0.63 0.47 0.53 1.1
O4  0.08 -0.04  0.14  0.36  0.38 0.26 0.74 2.4
O5  0.11 -0.05  0.10 -0.07 -0.52 0.27 0.73 1.2

                        F1   F2   F3   F4   F5
SS loadings           2.49 2.05 2.10 2.07 1.64
Proportion Var        0.10 0.08 0.08 0.08 0.07
Cumulative Var        0.10 0.18 0.27 0.35 0.41
Proportion Explained  0.24 0.20 0.20 0.20 0.16
Cumulative Proportion 0.24 0.44 0.64 0.84 1.00

 With factor correlations of 
      F1    F2    F3    F4    F5
F1  1.00 -0.21 -0.03  0.23 -0.01
F2 -0.21  1.00  0.20 -0.22  0.20
F3 -0.03  0.20  1.00 -0.31  0.23
F4  0.23 -0.22 -0.31  1.00 -0.17
F5 -0.01  0.20  0.23 -0.17  1.00

Mean item complexity =  1.6
Test of the hypothesis that 5 factors are sufficient.

The degrees of freedom for the null model are  300  and the objective function was  7.23 with Chi Square of  20163.79
The degrees of freedom for the model are 185  and the objective function was  0.63 

The root mean square of the residuals (RMSR) is  0.03 
The df corrected root mean square of the residuals is  0.04 

The harmonic number of observations is  2762 with the empirical chi square  1474.6  with prob <  1.3e-199 
The total number of observations was  2800  with MLE Chi Square =  1749.88  with prob <  1.4e-252 

Tucker Lewis Index of factoring reliability =  0.872
RMSEA index =  0.055  and the 90 % confidence intervals are  0.053 0.057
BIC =  281.47
Fit based upon off diagonal values = 0.98
Measures of factor score adequacy             
                                                 F1   F2   F3   F4   F5
Correlation of scores with factors             0.93 0.88 0.88 0.88 0.85
Multiple R square of scores with factors       0.86 0.77 0.78 0.78 0.72
Minimum correlation of possible factor scores  0.73 0.54 0.56 0.56 0.44
$\endgroup$

migration rejected from stackoverflow.com Feb 11 at 14:19

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by gung Feb 11 at 14:19

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ You can factor analyze a correlation matrix, without the raw data. It's not absolutely clear to me what your goal is, so I'm not sure why this wouldn't work - can you elaborate? $\endgroup$ – Jeremy Miles Jan 16 '15 at 17:41
  • $\begingroup$ I would like to create raw data from a correlation Matrix . In this case ordinal data on a scale from 1-10 $\endgroup$ – jonas Jan 17 '15 at 13:35
  • $\begingroup$ OK, I see. Your question is kind of complex, if that's all you want to do. For ordinal data, you need to specify the probability of each possible value, for each variable. Do you want a population, or a sample (i.e. do you want the correlations to match exactly?) If you don't, it can be done with Mplus (www.statmodel.com). $\endgroup$ – Jeremy Miles Jan 18 '15 at 20:34
  • $\begingroup$ You can use the svycor procedure in the jtools R package to compute a correlation matrix for complex sample surveys (with appropriate information on weighting, stratification, and clustering). This correlation matrix can then be inputted as the corrected estimates (with means, sds, & Ns) into other statistical procedures such as multiple regression, reliability analysis, factor analysis, SEM, etc. $\endgroup$ – Richard MacLennan Dec 27 '18 at 21:10

Browse other questions tagged or ask your own question.