Statistics Toolbox | ![]() ![]() |
Example: Finding Common Factors Affecting Stock Prices
Over the course of 100 weeks, the percent change in stock prices for ten companies has been recorded. Of the ten companies, the first four can be classified as primarily technology, the next three as financial, and last three as retail. It seems reasonable that the stock prices for companies that are in the same sector might vary together as economic conditions change. Factor Analysis can provide quantitative evidence that companies within each sector do experience similar week-to-week changes in stock price.
First load the data, then call factoran
and specify a model fit with three common factors. By default, factoran
would compute rotated estimates of the loadings to try and make their interpretation simpler, but for the moment, specify an unrotated solution.
The first two factoran
return arguments are the estimated loadings and the estimated specific variances. Each row of the loadings matrix represents one of the ten stocks, and each column corresponds to a common factor. With unrotated estimates, interpretation of the factors in this fit is difficult because most of the stocks contain fairly large coefficients for two or more factors.
Loadings Loadings = 0.8885 0.2367 -0.2354 0.7126 0.3862 0.0034 0.3351 0.2784 -0.0211 0.3088 0.1113 -0.1905 0.6277 -0.6643 0.1478 0.4726 -0.6383 0.0133 0.1133 -0.5416 0.0322 0.6403 0.1669 0.4960 0.2363 0.5293 0.5770 0.1105 0.1680 0.5524
Note Factor Rotation helps to simplify the structure in the loadings matrix, so that it will be easier to assign meaningful interpretations to the factors. |
From the estimated specific variances, we can see that the model indicates that a particular stock price varies quite a lot beyond the variation due to the common factors.
A specific variance of 1 would indicate that there is no common factor component in that variable, while a specific variance of 0 would indicate that the variable is entirely determined by common factors. These data seem to fall somewhere in between.
The p-value returned in the stats
structure fails to reject the null hypothesis of three common factors, suggesting that this model provides a satisfactory explanation of the covariation in these data.
To determine if fewer than three factors can provide an acceptable fit, you can try a model with two common factors. The p-value for this second fit is highly significant, and rejects the hypothesis of two factors, indicating that the simpler model is not sufficient to explain the pattern in these data.
[Loadings2,specificVar2,T2,stats2] = factoran(stocks, 2,... 'rotate','none'); stats2.p ans = 3.5610e-006
![]() | Factor Analysis | Factor Rotation | ![]() |