Learn R Programming

simsem (version 0.2-0)

simDataDist: Create a data distribution object.

Description

This function will create simResult by different ways. One way is to create data and analyze data multiple times by specifying SimData and SimModel and save it in the SimDataDist.

Usage

simDataDist(..., p=NULL, keepScale=TRUE, reverse=FALSE)

Arguments

...
List of distribution objects. See VirtualDist for a list of possible distributions.
p
Number of variables. If only one distribution object is listed, the p will make the same distribution objects for all variables.
keepScale
If TRUE, transform back to retain the mean and standard deviation of a variable equal to the model implied mean and standard deviation (with sampling error)
reverse
A vector representing of mirrorring each variable or not. If TRUE, reverse the distribution of a variable (e.g., from positive skewed to negative skewed. If one logical value is specified, it will apply to all variables.

Value

  • SimDataDist that saves analysis result from simulate data.

See Also

  • SimDatafor data model specification
  • SimModelfor analysis model specification
  • SimResultfor the type of resulting object

Examples

Run this code
loading <- matrix(0, 6, 1)
loading[1:6, 1] <- NA
LX <- simMatrix(loading, 0.7)
RPH <- symMatrix(diag(1))
RTD <- symMatrix(diag(6))
CFA.Model <- simSetCFA(LY = LX, RPS = RPH, RTE = RTD)
SimData <- simData(CFA.Model, 500)
SimModel <- simModel(CFA.Model)
# We make the examples running only 5 replications to save time.
# In reality, more replications are needed.
Output <- simResult(5, SimData, SimModel)
#summary(Output)

Run the code above in your browser using DataLab