plspm.plspm module¶
-
class
plspm.plspm.
Plspm
(data: pandas.core.frame.DataFrame, config: plspm.config.Config, scheme: plspm.scheme.Scheme = <Scheme.CENTROID: <plspm.scheme._CentroidInnerWeightCalculator object>>, iterations: int = 100, tolerance: float = 1e-06, bootstrap: bool = False, bootstrap_iterations: int = 100, processes: int = 2)¶ Bases:
object
Estimates path models with latent variables using partial least squares algorithm
Create an instance of this class in order to estimate a path model using the partial least squares algorithm. When the algorithm has performed the calculations to create the estimate, you can then retrieve the inner and outer models, scores, the path coefficients, effects, and reliability indicators such as goodness-of-fit and unidimensionality. Bootstrapping results can also be retrieved if they were requested.
-
__init__
(data: pandas.core.frame.DataFrame, config: plspm.config.Config, scheme: plspm.scheme.Scheme = <Scheme.CENTROID: <plspm.scheme._CentroidInnerWeightCalculator object>>, iterations: int = 100, tolerance: float = 1e-06, bootstrap: bool = False, bootstrap_iterations: int = 100, processes: int = 2)¶ Creates an instance of the path model calculator.
Parameters: - data – A Pandas DataFrame containing the dataset to be analyzed
- config – An instance of
config.Config
- scheme – The inner weighting scheme to use:
Scheme.CENTROID
(default),Scheme.FACTORIAL
orScheme.PATH
(see documentation forscheme
) - iterations – The maximum number of iterations to try to get the algorithm to converge (default and minimum 100).
- tolerance – The tolerance criterion for iterations (default 0.000001, must be >0)
- bootstrap – Whether to perform bootstrap validation (default is not to perform validation)
- bootstrap_iterations – The number of bootstrap samples to use if bootstrap validation is enabled (default and minimum 100)
- processes – The number of processes to use while bootstrapping (bootstrap_iterations must be a multiple of processes)
Raises: Exception – if the algorithm cannot converge, or if the requested configuration could not be calculated
-
bootstrap
() → plspm.bootstrap.Bootstrap¶ Gets the results of bootstrap validation, if requested
Returns: an instance of bootstrap.Bootstrap
which can be queried for bootstrapping resultsRaises: Exception – if bootstrap validation was not requested or if there were insufficient (<10) observations
-
crossloadings
() → pandas.core.frame.DataFrame¶ Gets the crossloadings
Returns: a DataFrame with the latent variables as the columns and the manifest variables as the index
-
effects
() → pandas.core.frame.DataFrame¶ Gets direct, indirect, and total effects for each path
Returns: a DataFrame with an entry in the index for every path in the model, and a column for direct, indirect, and total effects for the corresponding path.
-
goodness_of_fit
() → float¶ Gets goodness-of-fit
Returns: goodness-of-fit
-
inner_model
() → pandas.core.frame.DataFrame¶ Gets the inner model for the endogenous latent variables
Returns: a DataFrame with a row for each latent variable with a direct path to it, and columns for estimate, std error, t, and p>|t|.
-
inner_summary
() → pandas.core.frame.DataFrame¶ Gets a summary of the inner model
Returns: a DataFrame with the latent variables as the index, and columns for latent variable type (Exogenous or Endogenous), R squared, block communality, mean redundancy, and AVE (average variance extracted)
-
outer_model
() → pandas.core.frame.DataFrame¶ Gets the outer model
Returns: a DataFrame with columns for weight, loading, communality, and redundancy, and a row for each manifest variable
-
path_coefficients
() → pandas.core.frame.DataFrame¶ Gets the path coefficient matrix
Returns: a DataFrame of similar form to the Path matrix passed into plspm.config.Config
, with the relevant path coefficients in each cell
-
scores
() → pandas.core.frame.DataFrame¶ Gets the latent variable scores
Returns: a DataFrame with the latent variable scores, with a column for each latent variable. The index is the same as the index of the data passed in.
-
unidimensionality
() → pandas.core.frame.DataFrame¶ Gets the results of checking the unidimensionality of blocks (only meaningful for reflective / mode A blocks)
Returns: a DataFrame with the latent variables as the index, and columns for Cronbach’s Alpha, Dillon-Goldstein Rho, and the eigenvalues of the first and second principal components.
-