-
Notifications
You must be signed in to change notification settings - Fork 25
Vignette
simsem provides three methods for running a simulation. First, simsem provides a model specification framework by matrices. The framework is designed to have additional features that current SEM packages do not have (e.g., random parameters, sophisticated model misspecification, nonnormal factor distribution, and fixed covariate data). Second, simsem can take lavaan syntax in data generation and data analysis in running a simulation. This approach is easier for those who are familiar with lavaan. Third, simsem can use the OpenMx model to generate data based on starting values. Here are the advantages and disadvantages of all approaches:
- Generate data based on standardized parameters
- Data generation with random parameters
- Data generation with model misspecification
- Control the order of 1) finding unspecified parameters (e.g., find residual variances when total variances are specified), 2) imposing equality/nonlinear constraints, and 3) imposing model misspecification
- Sequential method for data generation (generate data at the factor level and use them to create indicator data)
- Nonnormal factor distribution and nonnormal error distribution
- Create data based on exogenous covariates
- Bollen-Stine bootstrap
- Slightly faster
- Generate data based on standardized parameters (see version 0.5-13 for the full support)
- Syntax-based input for both data generation and data analysis
- Create endogenous ordered categorical variables
- Create endogenous ordered categorical variables
- Simulate data based on definition variables
- Mixture model
- Parallel processing
- Nonnormal indicator distribution (by copula or Vale and Maurelli's method)
- Impose missing data (MCAR, MAR, or planned missing data)
- Simulation with different samples or percent missing across replications
- Nonlinear constraints and defined parameters
- Generate data from lavaan output
- Multiple imputation
- Modeling auxiliary variables
- Power analysis of the significance of parameter estimates and power analysis in rejecting bad models using absolute model fit, nested model comparison, or nonnested model comparison, accuracy in parameter estimation, coverage rate of confidence intervals.
- Transform generated data and extract additional outputs
- Run a simulation based on a population data set or a list of sample data sets
- Run a simulation until the specified number of convergent replications is obtained
- Users can write a function that returns a vector of parameter estimates, standard errors, fit indices, and convergence status and use the function in analyzing generated data, which will be automatically saved in the simulation result.
User can generate data using one format and analyze data by a different format. See examples for single group analysis and multiple group analysis.
This vignette is organized in examples. New users are recommended to read (or skim) at the starred examples. The first part is the list of examples using matrix specification. The second part is the list of examples using lavaan syntax. The third part is the list of examples using OpenMx. The last part is the list of examples for simsem version 0.2 (or lower).
- Example 1: Getting Started*
- Example 2: Covariance Matrix Specification*
- Example 3: Model Misspecification*
- Example 4: Random Parameters*
- Example 5: Equality Constraint*
- Example 6: Multiple Groups
- Example 7: Analyzing Real Data and then Run Monte Carlo Simulation
- Example 8: Missing Data Handling
- Example 9: Planned Missing Design
- Example 10: Missing at Random and Auxiliary Variable
- Example 11: Power Analysis in Model Evaluation
- Example 12: Nonnormal Distribution
- Example 13: Nonnormal Factor Distribution
- Example 14: Single Indicator
- Example 15: Analyzing Real Data with Multiple Imputation
- Example 16: Modeling an Endogenous Covariate
- Example 17: Select a Set of Variables for Analysis
- Example 18: Simulation with Varying Sample Size
- Example 19: Simulation with Varying Sample Size and Percent Missing
- Example 20: Simulation with Varying Sample Size and Parameters
- Example 21: Power of Rejecting Misspecified Models with Varying Sample Size
- Example 22: Power of Rejecting Misspecified Models with Varying Sample Size and Percent Missing
- Example 23: Specifying Trivial Misspecification
- Example 24: Nested Model Comparison
- Example 25: Nested Model Comparison with Varying Sample Size
- Example 26: Nested Model Comparison with Varying Sample Size and Percent Missing
- Example 27: Analyzing Real Data for Nested Model Comparison
- Example 28: Nonnested Model Comparison
- Example XX: Modeling an Exogenous Covariate
- Example XX: Simulating Moderated Mediation with Exogenous Covariates
- Example XX: Helpful Methods for Examining Simulation Result
- Example XX: Latent Variable Scores
- Example XX: Confidence Interval Width
- Example XX: Higher-order Factor Models
- Accessing Help Files
(The number listed follows the order of examples in the simsem matrix specification)
- Example 2: Getting Started*
- Example 5: Equality Constraint*
- Example 6: Multiple Groups
- Example 7: Analyzing Real Data and then Run Monte Carlo Simulation
- Example 8 Missing Data Handling
- Example 9 Planned Missing Design
- Example 10: Missing at Random and Auxiliary Variable
- Example 11: Power Analysis in Model Evaluation
- Example 12: Nonnormal Distribution
- Example 14: Single Indicator
- Example 15: Analyzing Real Data with Multiple Imputation
- Example 16: Modeling an Endogenous Covariate
- Example 17: Select a Set of Variables for Analysis
- Example 18: Simulation with Varying Sample Size
- Example 19: Simulation with Varying Sample Size and Percent Missing
- Example 21: Power of Rejecting Misspecified Models with Varying Sample Size
- Example 22: Power of Rejecting Misspecified Models with Varying Sample Size and Percent Missing
- Example 24: Nested Model Comparison
- Example 25: Nested Model Comparison with Varying Sample Size
- Example 26: Nested Model Comparison with Varying Sample Size and Percent Missing
- Example 27: Analyzing Real Data for Nested Model Comparison
- Example 28: Nonnested Model Comparison
- Example XX: Ordered Categorical Indicators
- Example XX: Bootstrap Confidence Interval
- Example XX: Higher-order Factor Models
- Accessing Help Files
(The number listed follows the order of examples in the simsem matrix specification)
- Example 2: Getting Started*
- Example 5: Equality Constraint*
- Example 6: Multiple Groups
- Example 7: Analyzing Real Data and then Run Monte Carlo Simulation
- Example 8 Missing Data Handling
- Example 9 Planned Missing Design
- Example 10: Missing at Random and Auxiliary Variable
- Example 11: Power Analysis in Model Evaluation
- Example 12: Nonnormal Distribution
- Example 14: Single Indicator
- Example 15: Analyzing Real Data with Multiple Imputation
- Example 16: Modeling an Endogenous Covariate
- Example 17: Select a Set of Variables for Analysis
- Example 18: Simulation with Varying Sample Size
- Example 19: Simulation with Varying Sample Size and Percent Missing
- Example 21: Power of Rejecting Misspecified Models with Varying Sample Size
- Example 22: Power of Rejecting Misspecified Models with Varying Sample Size and Percent Missing
- Example 24: Nested Model Comparison
- Example 25: Nested Model Comparison with Varying Sample Size
- Example 26: Nested Model Comparison with Varying Sample Size and Percent Missing
- Example 27: Analyzing Real Data for Nested Model Comparison
- Example 28: Nonnested Model Comparison
- Example XX: Ordered Categorical Indicators
- Example XX: Definition Variables
- Example XX: Growth Mixture Model
- Example XX: Profile-Likelihood Confidence Interval
- Running a Simulation with simsem for Almost All OpenMx Demo Examples
- Accessing Help Files
- Example 1: Getting Started
- Example 2: Covariance Matrix Specification
- Example 3: Model Misspecification
- Example 4: Random Parameters
- Example 5: Equality Constraint
- Example 6: Power Analysis in Model Evaluation
- Example 7: Missing Data Handling
- Example 8: Planned Missing Design
- Example 9: Nonnormal Distribution
- Example 10: Nonnormal Factor Distribution
- Example 11: Single Indicator
- Example 12: Missing at Random and Auxiliary Variable
- Example 13: Analyzing Real Data and Monte Carlo Approach for Model Fit Evaluation
- Example 14: Analyzing Real Data with Multiple Imputation
- Example 15: Modeling a Covariate
- Example 16: Select a Set of Variables for Analysis
- Example 17: Simulation with Varying Sample Size
- Example 18: Simulation with Varying Sample Size and Percent Missing
- Example 19: Simulation with Varying Sample Size and Parameters
- Example 20: Power of Rejecting Misspecified Models with Varying Sample Size
- Example 21: Power of Rejecting Misspecified Models with Varying Sample Size and Percent Missing
- Example 22: Specifying Trivial Misspecification
- Example 23: Nested Model Comparison
- Example 24: Nested Model Comparison with Varying Sample Size
- Example 25: Nested Model Comparison with Varying Sample Size and Percent Missing
- Summary of Model Specification
- Accessing Help Files
- Distribution Objects
- Public Classes and Functions
- Symbols of Vectors and Matrices
- Fit Indices Details