Performes a maximum likelihood factor analysis on a data frame or matrix and plots the factor solution as ellipses or tiles. In case a data frame is used as argument, the cronbach's alpha value for each factor scale will be calculated, i.e. all variables with the highest loading for a factor are taken for the reliability test. The result is an alpha value for each factor dimension.
sjp.fa(data, rotation = c("promax", "varimax"), method = c("ml",
"minres", "wls", "gls", "pa", "minchi", "minrank"), nmbr.fctr = NULL,
fctr.load.tlrn = 0.1, digits = 2, title = NULL,
axis.labels = NULL, type = c("bar", "circle", "tile"),
geom.size = 0.6, geom.colors = "RdBu", wrap.title = 50,
wrap.labels = 30, show.values = TRUE, show.cronb = TRUE)
A data frame that should be used to compute a FA, or a fa
object.
Rotation of the factor loadings. May be "varimax"
for orthogonal rotation
or "promax"
for oblique transformation (default). Requires the "GPArotation"
package.
the factoring method to be used. "ml"
will do a maximum likelihood factor analysis (default).
"minres"
will do a minimum residual (OLS),
"wls"
will do a weighted least squares (WLS) solution,
"gls"
does a generalized weighted least squares (GLS),
"pa"
will do the principal factor solution,
"minchi"
will minimize the sample size weighted chi square
when treating pairwise correlations with different number of
subjects per pair. "minrank"
will do a minimum rank factor analysis.
Number of factors used for calculating the rotation. By
default, this value is NULL
and the amount of factors is
calculated according to a parallel analysis.
Specifies the minimum difference a variable needs to have between factor loadings (components) in order to indicate a clear loading on just one factor and not diffusing over all factors. For instance, a variable with 0.8, 0.82 and 0.84 factor loading on 3 possible factors can not be clearly assigned to just one factor and thus would be removed from the principal component analysis. By default, the minimum difference of loading values between the highest and 2nd highest factor should be 0.1
Amount of decimals for estimates
character vector, used as plot title. Depending on plot type and function,
will be set automatically. If title = ""
, no title is printed.
For effect-plots, may also be a character vector of length > 1,
to define titles for each sub-plot or facet.
character vector with labels used as axis labels. Optional argument, since in most cases, axis labels are set automatically.
Plot type resp. geom type. May be one of following: "circle"
or "tile"
circular or tiled geoms, or "bar"
for a bar plot. You may use initial letter only
for this argument.
size resp. width of the geoms (bar width, line thickness or point size, depending on plot type and function). Note that bar and bin widths mostly need smaller values than dot sizes.
user defined color for geoms. See 'Details' in plot_grpfrq
.
numeric, determines how many chars of the plot title are displayed in one line and when a line break is inserted.
numeric, determines how many chars of the value, variable or axis labels are displayed in one line and when a line break is inserted.
Logical, whether values should be plotted or not.
Logical, if TRUE
(default), the cronbach's alpha value for each factor scale will be calculated,
i.e. all variables with the highest loading for a factor are taken for the
reliability test. The result is an alpha value for each factor dimension.
Only applies when data
is a data frame.
(Invisibly) returns a structure
with
the rotated factor loading matrix (rotate
)
the column indices of removed variables (for more details see next list item) (removed.colindex
)
an updated data frame containing all factors that have a clear loading on a specific scale in case data
was a data frame (See argument fctr.load.tlrn
for more details) (removed.df
)
the factor.index
, i.e. the column index of each variable with the highest factor loading for each factor,
the ggplot-object (plot
),
the data frame that was used for setting up the ggplot-object (df
).
# NOT RUN {
library(GPArotation)
data(efc)
# recveive first item of COPE-index scale
start <- which(colnames(efc) == "c82cop1")
# recveive last item of COPE-index scale
end <- which(colnames(efc) == "c90cop9")
# use data frame as argument, let sjp.fa() compute FA
sjp.fa(efc[, start:end])
sjp.fa(efc[, start:end], type = "tile")
# }
Run the code above in your browser using DataLab