gen.latent.datasets: Generate multiple datasets of latent underlying variables

Description Usage Arguments Value Examples

Description

Given ordinal responses to survey questions, we generate multiple underlying latent variable datasets

Usage

1
2
gen.latent.datasets(M, data, grp.indicator, scores = "Bartlett",
  num.iter = 5)

Arguments

M

number of datasets to construct.

data

a (non-empty) numeric vector of data values.

grp.indicator

a (non-empty) numeric vector of data values.

scores

type of score to use.

num.iter

number of iterations to use in imputation step

Value

A list containing datasets with latent underlying variables

Examples

1
2
3
4
5
6
7
8
9
# Create indicators (a label indicating which latent variable the question corresponds to)
grp.indicator <- sapply(names(multiis), FUN =
                         function(x){strsplit(x, split = "_")[[1]][2]})

latent.datasets <- gen.latent.datasets(5, multiis, grp.indicator = grp.indicator, num.iter = 1)

head(latent.datasets[[1]])

head(latent.datasets[[2]])

rosiezou/440proj documentation built on May 12, 2019, 6:25 p.m.