sim.skewed {MonteCarloSEM}R Documentation

Simulates Data sets by a given Confirmatory Factor Analysis model.

Description

Based on a given Confirmatory Factor Analysis model, this function simulates data sets. In each data file, the first column shows sample numbers. The second and other columns show actual simulated data sets for each item. If the model has 2 factors and each factor has 3 items, for example, column names will be something like "ID, F1_x1, F1_x2, F1_x3, F2_x1, F2_x2, F2_x3". On the other hand, the number of rows shows the sample number of the data. Besides, there will be two more files saved in the folder. First of them is "Model_Info.dat". This file includes factor correlation and factor loading matrices, a vector showing non-normal items and values of B, C, and D for Fleishman's power method. The second is "Data_List.dat". The file contains the names of the data sets which were generated.

Usage

sim.skewed(
  nd = 10,
  ss = 100,
  fcors,
  loading,
  nonnormal = NULL,
  Fleishman = NULL,
  f.loc
)

Arguments

nd

Number of the data set, an integer.

ss

The sample Size, an integer and larger than 10.

fcors

The factor correlation matrix, a symmetric matrix. If one-factor model is used this should be matrix(1,1,1).

loading

The factor loading matrix. The column represents number of factors and non-zero rows represent the number of items under each factor.

nonnormal

A vector of 0 and 1s. 0 indicates normal, and 1 indicates non-normal data generation. If nonnormal is not indicated normal data will be generated.

Fleishman

The B, C, and D values from Fleishman's power method. A = -C.

f.loc

File location. Generated data sets will be saved at the user-defined location.

Author(s)

Fatih Orçan

Examples

fc<-fcors.value(nf=3, cors=c(1,.5,.6,.5,1,.4,.6,.4,1))
fl<-loading.value(nf=3, fl.loads=c(.5,.5,.5,0,0,0,0,0,0,0,0,.3,.3,.3,0,0,0,0,0,0,0,0,.4,.4))
ifN<-c(1,1,1,0,0,0,0,0)
fleis<-c(1.0174852, .190995, -.018577) # The values for skewness=1 and kurtosis=1

sim.skewed(nd=10, ss=100, fcors=fc,loading=fl, nonnormal = ifN, Fleishman = fleis, f.loc=tempdir())

[Package MonteCarloSEM version 0.0.8 Index]