Skip to content

Commit b26afe3

Browse files
author
jbiggsets
committed
updates to docs
1 parent 25942e7 commit b26afe3

File tree

3 files changed

+89
-40
lines changed

3 files changed

+89
-40
lines changed

doc/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
# General information about the project.
6060
project = 'factor_analyzer'
61-
copyright = '2017, Jeremy Biggs'
61+
copyright = '2019, Jeremy Biggs'
6262
author = 'Jeremy Biggs'
6363

6464
# The version info for the project you're documenting, acts as replacement for
@@ -183,8 +183,6 @@
183183
'Miscellaneous'),
184184
]
185185

186-
187-
188186
# -- Options for Epub output ----------------------------------------------
189187

190188
# Bibliographic Dublin Core info.
@@ -205,7 +203,5 @@
205203
# A list of files that should not be packed into the epub file.
206204
epub_exclude_files = ['search.html']
207205

208-
209-
210206
# Example configuration for intersphinx: refer to the Python standard library.
211207
intersphinx_mapping = {'https://docs.python.org/': None}

doc/factor_analyzer.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ factor\_analyzer package
1515
:undoc-members:
1616
:show-inheritance:
1717

18+
:py:mod:`factor\_analyzer\.confirmatory\_factor\_analyzer` Module
19+
--------------------------------------------------------
20+
.. automodule:: factor_analyzer.confirmatory_factor_analyzer
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
1825
:py:mod:`factor\_analyzer\.rotator` Module
1926
--------------------------------------------------------
2027
.. automodule:: factor_analyzer.rotator

doc/index.rst

Lines changed: 81 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,89 @@
66
Welcome to the FactorAnalyzer documentation!
77
==============================================
88

9-
This is Python module to perform exploratory factor analysis, with optional varimax and promax rotations. Estimation can be performed using a minimum residual (minres) solution, or maximum likelihood estimation (MLE).
10-
11-
Portions of this code are ported from the excellent R library psych.
9+
This is a Python module to perform exploratory and factor analysis (EFA), with several
10+
optional rotations. It also includes a class to perform confirmatory factor
11+
analysis (CFA), with certain pre-defined constraints. In expoloratory factor analysis,
12+
factor extraction can be performed using a variety of estimation techniques. The
13+
``factor_analyzer`` package allows users to perfrom EFA using either (1) a minimum
14+
residual (MINRES) solution, (2) a maximum likelihood (ML) solution, or (3) a principal
15+
factor solution. However, CFA can only be performe using an ML solution.
16+
17+
Both the EFA and CFA classes within this package are fully compatible with `scikit-learn`.
18+
Portions of this code are ported from the excellent R library `psych`, and the `sem`
19+
package provided inspiration for the CFA class.
1220

1321
Description
14-
==================
15-
16-
Exploratory factor analysis (EFA) is a statistical technique used to identify latent relationships among sets of observed variables in a dataset. In particular, EFA seeks to model a large set of observed variables as linear combinations of some smaller set of unobserved, latent factors.
17-
18-
The matrix of weights, or factor loadings, generated from an EFA model describes the underlying relationships between each variable and the latent factors. Typically, a number of factors (K) is selected such that is substantially smaller than the number of variables. The factor analysis model can be estimated using a variety of standard estimation methods, including but not limited to OLS, minres, or MLE.
19-
20-
This package includes a stand-alone Python module with a ``FactorAnalyzer()`` class. The class includes an ``analyze()`` method that allows users to perform factor analysis using either minres or MLE, with optional rotations on the factor loading matrices. The package also offers a stand-alone ``Rotator()`` class to perform common rotations on an unrotated loading matrix.
21-
22-
The ``factor_analyzer`` package offers the following rotation methods:
23-
24-
* The **varimax** (orthogonal)
25-
26-
* The **promax** (oblique)
27-
28-
* The **quartimax** (orthogonal)
29-
30-
* The **quartimin** (oblique)
31-
32-
* The **obliimax** (orthogonal)
33-
34-
* The **oblimin** (oblique)
35-
36-
* The **obliimax** (orthogonal)
37-
38-
* The **equamax** (orthogonal)
39-
40-
This package includes a stand-alone Python module with a ``FactorAnalyzer()`` class. The class includes an ``analyze()`` method that allows users to perform factor analysis using either minres or MLE, with optional promax or varimax rotations on the factor loading matrices. The package also offers a stand-alone ``Rotator()`` class to perform common rotations on an unrotated loading matrix.
22+
============
23+
24+
Exploratory factor analysis (EFA) is a statistical technique used to
25+
identify latent relationships among sets of observed variables in a
26+
dataset. In particular, EFA seeks to model a large set of observed
27+
variables as linear combinations of some smaller set of unobserved,
28+
latent factors. The matrix of weights, or factor loadings, generated
29+
from an EFA model describes the underlying relationships between each
30+
variable and the latent factors.
31+
32+
Confirmatory factor analysis (CFA), a closely associated technique, is
33+
used to test an a priori hypothesis about latent relationships among sets
34+
of observed variables. In CFA, the researcher specifies the expected pattern
35+
of factor loadings (and possibly other constraints), and fits a model according
36+
to this specification.
37+
38+
Typically, a number of factors (K) in an EFA or CFA model is selected
39+
such that it is substantially smaller than the number of variables. The
40+
factor analysis model can be estimated using a variety of standard
41+
estimation methods, including but not limited MINRES or ML.
42+
43+
Factor loadings are similar to standardized regression coefficients, and
44+
variables with higher loadings on a particular factor can be interpreted
45+
as explaining a larger proportion of the variation in that factor. In the
46+
case of EFA, factor loading matrices are usually rotated after the factor
47+
analysis model is estimated in order to produce a simpler, more interpretable
48+
structure to identify which variables are loading on a particular factor.
49+
50+
Two common types of rotations are:
51+
52+
1. The **varimax** rotation, which rotates the factor loading matrix so
53+
as to maximize the sum of the variance of squared loadings, while
54+
preserving the orthogonality of the loading matrix.
55+
56+
2. The **promax** rotation, a method for oblique rotation, which builds
57+
upon the varimax rotation, but ultimately allows factors to become
58+
correlated.
59+
60+
This package includes a ``factor_analyzer`` module with a stand-alone
61+
``FactorAnalyzer`` class. The class includes ``fit()`` and ``transform()``
62+
methods that enable users to perform factor analysis and score new data
63+
using the fitted factor model. Users can also perform optional otations
64+
on a factor loading matrix using the ``Rotator`` class.
65+
66+
The following rotation options are available in both ``FactorAnalyzer``
67+
and ``Rotator``:
68+
69+
(a) varimax (orthogonal rotation)
70+
(b) promax (oblique rotation)
71+
(c) oblimin (oblique rotation)
72+
(d) oblimax (orthogonal rotation)
73+
(e) quartimin (oblique rotation)
74+
(f) quartimax (orthogonal rotation)
75+
(g) equamax (orthogonal rotation)
76+
77+
In adddition, the package includes a ``confirmatory_factor_analyzer``
78+
module with a stand-alone ``ConfirmatoryFactorAnalyzer`` class. The
79+
class includes ``fit()`` and ``transform()`` that enable users to perform
80+
confirmatory factor analysis and score new data using the fitted model.
81+
Performing CFA requires users to specify in advance a model specification
82+
with the expected factor loading relationships. This can be done using
83+
the ``ModelSpecificationParser`` class.
4184

4285
Requirements
4386
==================
44-
- Python 3.4 or higher
45-
- ``numpy``
46-
- ``pandas``
47-
- ``scipy``
87+
- Python 3.4 or higher
88+
- ``numpy``
89+
- ``pandas``
90+
- ``scipy``
91+
- ``scikit-learn``
4892

4993
Installation
5094
==================
@@ -55,14 +99,16 @@ You can install this package via ``pip`` with:
5599

56100
Alternatively, you can install via ``conda`` with:
57101

58-
``$ conda install -c desilinguist factor_analyzer``
102+
``$ conda install -c ets factor_analyzer``
59103

60104
.. toctree::
61105
:maxdepth: 2
62106
:caption: Contents:
63107

64108
factor_analyzer
65109

110+
confirmatory_factor_analyzer
111+
66112
rotator
67113

68114

0 commit comments

Comments
 (0)