Learn R Programming

RGenData (version 1.0)

GenDataSample: GenDataSample

Description

Bootstraps each variable's score distribution from a supplied data set.

Usage

GenDataSample(supplied.data, n.factors = 0, max.trials = 5, initial.multiplier = 1,
corr.type = "pearson", seed = 0)

Arguments

supplied.data

Data supplied by user.

n.factors

Number of factors (scalar, default is 0).

max.trials

Maximum number of trials (scalar, default is 5).

initial.multiplier

Value of initial multiplier (scalar, default is 1).

corr.type

Type of correlation (character, default is "pearson", user can also call "spearman").

seed

seed value (scalar, default is 0).

Value

dataSample of data

References

Ruscio & Kaczetow (2008)

Examples

Run this code
# NOT RUN {
# create data matrix x with n = 200 cases, k = 9 variables
# 3 variables load onto each of 3 orthogonal factors
# all marginal distributions are highly skewed
x <- matrix(nrow = 200, ncol = 9)
for (i in 1:3) {
  shared <- rchisq(200, 1)
  for (j in 1:3) {
    x[, (i - 1) * 3 + j] <- shared + rchisq(200, 1)
  }
}
# generate sample of data reproducing distributions and correlations in x
GenDataSample(x)
# }

Run the code above in your browser using DataLab