FACTOR ANALYSIS OF ECONOMIC PERCEPTION ITEMS

Similar documents
Transcription:

Measurement, Scaling, and Dimensional Analysis Bill Jacoby Summer 2017 FACTOR ANALYSIS OF ECONOMIC PERCEPTION ITEMS This handout shows the log for a STATA session that performs a factor analysis on citizens responses to eight survey questions about their perceptions of personal financial conditions and the national economy. All variables are scored on scales ranging from 1 to 5, with larger values indicating more pessimistic economic perceptions. The data are taken from the 1992 CPS National Election Study and there are 1665 observations in the dataset. The variables and the acronyms used for variable names in the STATA session are as follows (Note that question wordings are paraphrased from the interview schedule): bet1yr inccol unem1yr infl1yr nec1yr necmos nec4yr jobworr Has your family been getting along better or worse over the past year? Has your family s income been keeping up with the cost of living over the past year? Do you think unemployment has been getting better or worse in the past year? Do you think inflation has been getting better or worse in the past year? Do you think the national economy has been getting better or worse in the past year? Do you think the national economy has been getting better or worse in the past few months? Do you think the national economy has been getting better or worse in the past 4 years? Are you worried about the possibility of losing your job? Part I: STATA Log ----------- log: e:\stata factor analysis, 1.smcl log type: smcl. Change delimiter to semicolon and set MORE condition off.. #delimit ; delimiter now ;. set more off; > Retrieve dataset on > 1992 public opinion > about economic conditions.. use econ;

Page 2. describe; Contains data from econ.dta obs: 1,665 vars: 9 size: 66,600 (93.6% of memory free) ----------- storage display value variable name type format label variable label ----------- caseid float %9.0g bet1yr float %9.0g FAMILY GETTING ALONG BETTER/WORSE? inccol float %9.0g INCOME KEEPING UP W COST OF LIVING? unem1yr float %9.0g UNEMPLT BETTER/WORSE IN PAST YR? infl1yr float %9.0g INFLTN BETTER/WORSE IN PAST YR? nec1yr float %9.0g NATL ECON BETTER/WORSE IN PAST YR? necmos float %9.0g NATL ECON BETT/WORSE IN PST FEW MOS? nec4yr float %9.0g NATL ECON BETT/WORSE IN PST 4 YRS? jobworr float %9.0g WORRIED ABOUT EMPLOYMENT STATUS? ----------- Sorted by: > Obtain summary statistics > and correlation matrix. summarize bet1yr inccol unem1yr infl1yr nec1yr > necmos nec4yr jobworr; Variable Obs Mean Std. Dev. Min Max -------------+---------------------- bet1yr 1665 3.054655 1.13564 1 5 inccol 1665 3.526126 1.029351 1 5 unem1yr 1665 4.251652.8282707 1 5 infl1yr 1665 3.666066.9355212 1 5 nec1yr 1665 4.049249.9086793 1 5 -------------+---------------------- necmos 1665 3.366366.8329586 1 5 nec4yr 1665 4.275676.8887873 1 5 jobworr 1665 1.828829 1.376358 1 5. correlate bet1yr inccol unem1yr > infl1yr nec1yr necmos nec4yr jobworr; (obs=1665) bet1yr inccol unem1yr infl1yr nec1yr necmos nec4yr -------------+----------------------------- bet1yr 1.0000 inccol 0.5609 1.0000 unem1yr 0.2518 0.2478 1.0000 infl1yr 0.2310 0.2993 0.3489 1.0000 nec1yr 0.2606 0.2627 0.5377 0.4322 1.0000 necmos 0.2107 0.2026 0.3558 0.2813 0.4414 1.0000 nec4yr 0.2155 0.1816 0.4453 0.2496 0.5145 0.3205 1.0000 jobworr 0.1925 0.2189 0.1638 0.1320 0.1403 0.1218 0.0843 jobworr -------------+--------- jobworr 1.0000

Page 3 > Perform factor analysis, > specifying principal axis > factoring with iterated > communality estimation, > and two common factors. factor bet1yr inccol unem1yr > infl1yr nec1yr necmos nec4yr > jobworr, ipf factors(2); (obs=1665) Factor analysis/correlation Number of obs = 1665 Method: iterated principal factors Retained factors = 2 Rotation: (unrotated) Number of params = 15 ------ Factor Eigenvalue Difference Proportion Cumulative -------------+-------------------------- Factor1 2.53669 1.74260 0.7616 0.7616 Factor2 0.79409 0.71645 0.2384 1.0000 Factor3 0.07764 0.03131 0.0233 1.0233 Factor4 0.04633 0.03307 0.0139 1.0372 Factor5 0.01326 0.03159 0.0040 1.0412 Factor6-0.01833 0.01995-0.0055 1.0357 Factor7-0.03828 0.04238-0.0115 1.0242 Factor8-0.08067. -0.0242 1.0000 ------ LR test: independent vs. saturated: chi2(28) = 3005.18 Prob>chi2 = 0.0000 Factor loadings (pattern matrix) and unique variances --------------- Variable Factor1 Factor2 Uniqueness -------------+--------------------+-------------- bet1yr 0.5190 0.4007 0.5700 inccol 0.5955 0.6232 0.2570 unem1yr 0.6481-0.2102 0.5357 infl1yr 0.5166-0.0343 0.7319 nec1yr 0.7627-0.3158 0.3186 necmos 0.5126-0.1510 0.7144 nec4yr 0.5632-0.2470 0.6218 jobworr 0.2530 0.1275 0.9197 --------------- > The next command produces a scree plot > (illustrated below, in Figure 1). screeplot, > scheme(s1color) > xaxis (1 2) > yaxis (1 2) > ylabel(, axis(1) nogrid) > ylabel(, axis(2) nolabel) > xlabel(, axis(2) nolabel) > xsize(4) > xtitle("", axis(2)) > ytitle("", axis(2))

Page 4 > The next command > writes the scree plot > to an external file. graph export scree.wmf, replace; (file e:\scree.wmf written in Windows Metafile format) > The next command displays the > squared multiple correlations > between each variable and the > seven other variables- these > were used as the initial > communality estimates. estat smc; Squared multiple correlations of variables with all other variables ----------------------- Variable smc -------------+--------- bet1yr 0.3405 inccol 0.3584 unem1yr 0.3620 infl1yr 0.2420 nec1yr 0.4697 necmos 0.2330 nec4yr 0.3134 jobworr 0.0685 ----------------------- > The next command displays the > residual correlation matrix. estat residuals; Raw residuals of correlations (observed-fitted) Variable bet1yr inccol unem1yr infl1yr nec1yr necmos -------------+-------------------- bet1yr 0.0000 inccol 0.0021 0.0000 unem1yr -0.0004-0.0072 0.0000 infl1yr -0.0234 0.0130 0.0069 0.0000 nec1yr -0.0087 0.0053-0.0230 0.0273 0.0000 necmos 0.0052-0.0086-0.0082 0.0112 0.0028 0.0000 nec4yr 0.0222 0.0002 0.0284-0.0499 0.0069-0.0055 jobworr 0.0100-0.0113 0.0266 0.0057-0.0124 0.0114 Variable nec4yr jobworr -------------+------------------ nec4yr 0.0000 jobworr -0.0267 0.0000 > Next, perform an orthogonal, > varimax rotation

Page 5. rotate, varimax; Factor analysis/correlation Number of obs = 1665 Method: iterated principal factors Retained factors = 2 Rotation: orthogonal varimax (Horst off) Number of params = 15 ------ Factor Variance Difference Proportion Cumulative -------------+-------------------------- Factor1 1.98176 0.63275 0.5950 0.5950 Factor2 1.34901. 0.4050 1.0000 ------ LR test: independent vs. saturated: chi2(28) = 3005.18 Prob>chi2 = 0.0000 Rotated factor loadings (pattern matrix) and unique variances --------------- Variable Factor1 Factor2 Uniqueness -------------+--------------------+-------------- bet1yr 0.2024 0.6237 0.5700 inccol 0.1400 0.8505 0.2570 unem1yr 0.6537 0.1923 0.5357 infl1yr 0.4459 0.2632 0.7319 nec1yr 0.8079 0.1697 0.3186 necmos 0.5084 0.1646 0.7144 nec4yr 0.6043 0.1138 0.6218 jobworr 0.1369 0.2480 0.9197 --------------- Factor rotation matrix Factor1 Factor2 -------------+------------------ Factor1 0.8256 0.5643 Factor2-0.5643 0.8256 > The next command displays the > correlation matrix for the factors, > to verify that they are orthogonal. estat common; Correlation matrix of the varimax rotated common factors Factors Factor1 Factor2 -------------+-------------------- Factor1 1 Factor2 0 1 > The next two commands estimate > the factor scores, and correlate > these estimated factors. predict factor1 factor2; (regression scoring assumed)

Page 6 Scoring coefficients (method = regression; based on varimax rotated factors) Variable Factor1 Factor2 -------------+-------------------- bet1yr -0.00557 0.22556 inccol -0.14635 0.73168 unem1yr 0.24679-0.00696 infl1yr 0.09538 0.03046 nec1yr 0.51527-0.08155 necmos 0.13508 0.00350 nec4yr 0.18898-0.03601 jobworr 0.01233 0.05568. correlate factor1 factor2; (obs=1665) factor1 factor2 -------------+------------------ factor1 1.0000 factor2 0.1018 1.0000 > The next command performs > an oblique, promax rotation. rotate, promax; Factor analysis/correlation Number of obs = 1665 Method: iterated principal factors Retained factors = 2 Rotation: oblique promax (Horst off) Number of params = 15 ------ Factor Variance Proportion Rotated factors are correlated -------------+-------------------------- Factor1 2.35735 0.7078 Factor2 1.78485 0.5359 ------ LR test: independent vs. saturated: chi2(28) = 3005.18 Prob>chi2 = 0.0000 Rotated factor loadings (pattern matrix) and unique variances --------------- Variable Factor1 Factor2 Uniqueness -------------+--------------------+-------------- bet1yr 0.0449 0.6320 0.5700 inccol -0.0911 0.9042 0.2570 unem1yr 0.6761 0.0103 0.5357 infl1yr 0.4227 0.1542 0.7319 nec1yr 0.8554-0.0630 0.3186 necmos 0.5215 0.0248 0.7144 nec4yr 0.6437-0.0617 0.6218 jobworr 0.0811 0.2337 0.9197 ---------------

Page 7 Factor rotation matrix Factor1 Factor2 -------------+------------------ Factor1 0.9471 0.7540 Factor2-0.3208 0.6568 > The next two commands display the > correlation matrix for the factors > and the factor structure matrix, giving > correlations between variables and > factors. estat common; Correlation matrix of the promax(3) rotated common factors Factors Factor1 Factor2 -------------+-------------------- Factor1 1 Factor2.5035 1. estat structure; Structure matrix: correlations between variables and promax(3) rotated common factors Variable Factor1 Factor2 -------------+-------------------- bet1yr 0.3630 0.6546 inccol 0.3641 0.8584 unem1yr 0.6813 0.3507 infl1yr 0.5003 0.3670 nec1yr 0.8237 0.3677 necmos 0.5340 0.2873 nec4yr 0.6126 0.2624 jobworr 0.1987 0.2745 > The next two commands generate > factor scores for the oblique-rotated > factors, and correlate the estimated factors. predict factor1a factor2a; (regression scoring assumed)

Page 8 Scoring coefficients (method = regression; based on promax(3) rotated factors) Variable Factor1 Factor2 -------------+-------------------- bet1yr 0.05546 0.21689 inccol 0.05636 0.67124 unem1yr 0.23577 0.05541 infl1yr 0.10006 0.05349 nec1yr 0.47419 0.05084 necmos 0.13102 0.03740 nec4yr 0.17227 0.01274 jobworr 0.02689 0.05699. correlate factor1a factor2a; (obs=1665) factor1a factor2a -------------+------------------ factor1a 1.0000 factor2a 0.5756 1.0000 > Close the log and > end the STATA session. log close; log: e:\factor analysis\econ92\starting 2005\stata factor analysis, 1.s > mcl log type: smcl ----------- Figure 1: Scree plot showing the eigenvalues associated with each factor, in the order of extraction Scree plot of eigenvalues after factor Eigenvalues 0.5 1 1.5 2 2.5 0 2 4 6 8 Number

Page 9 Figure 2: Plot of initial (unrotated) common factor space. 1.0 inccol Initial (unrotated) factor 2 0.5 0.0 jobworr bet1yr infl1yr necmos unem1yr nec4yr nec1yr -0.5-0.5 0.0 0.5 1.0 Initial (unrotated) factor 1 Figure 3: Plot of varimax rotated common factor space 1.0 0.8 inccol Varimax rotated factor 2 0.6 0.4 bet1yr 0.2 jobworr infl1yr unem1yr necmos nec1yr nec4yr 0.0 0.0 0.2 0.4 0.6 0.8 1.0 Varimax rotated factor 1

Page 10 Figure 4: Plot of promax oblique factor space. Correlated factor axes are shown as dashed lines, and variable labels have been omitted from the vectors for clarity. 1.0 Factor 2 0.8 0.6 0.4 Factor 1 0.2 0.0 0.0 0.2 0.4 0.6 0.8 1.0