rep_style_rel: Replicate a Style Simulation and Investigate Effect on...

Description Usage Arguments Value See Also

View source: R/fun_replicate-simulation.R

Description

This function replicates sim_style_data and returns the observed coefficient alpha as well as the response style-free alpha for every replication sample.

Usage

1
2
3
4
rep_style_rel(reps = 1000, n = c(100, 1000), items = c(5, 10),
  categ = c(3, 7), ndimc = 1, style = NULL, reversed = c(0, 0.5),
  mu.s = c(-1, 1), var.s = c(0, 1), df = 10, sig = NULL, emp = TRUE,
  ...)

Arguments

reps

Numeric, the desired number of replications.

n

Numeric, the number of persons. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively.

items

Numeric, the number of items. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively.

categ

Numeric, the number of categories per item. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively..

ndimc

Numeric. Desired number of content-related latent variables (irrespective of number of style-related latent variables).

style

Parameter to specify which response style(s) influence the data, can be either numeric or character. Users may choose one or more among "ERS1" (e.g., 1 / 0 / 0 / 0 / 1), "ERS2" (e.g., 2 / 1 / 0 / 1 / 2), "ARS" (e.g., 0 / 0 / 0 / 1 / 1), "ADRS" (e.g, -1 / -1 / 0 / 1 / 1), and "MRS" (e.g., 0 / 0 / 1 / 0 / 0). Alternatively, a user-specified vector of weights can be employed. Can also be NULL indicating complete abscence of response styles.

reversed

Numeric, the number of reverse-coded items. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively.

mu.s

Numeric, the response style mean. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively.

var.s

Numeric, the response style variance. If of length one, it's fixed to the provided value. If of length two, it's sampled from a uniform distribution using the two values as lower and upper limits, respectively.

df

Numeric. The df-parameter of the Wishart distribution from which the covariance is drawn.

sig

Numeric matrix. The variance-covariance matrix of the multivariate distribution of thetas. If non-NULL, this overrides var.s.

emp

Logical. If true, mu.s and var.s/sig specify the empirical not population mean and covariance matrix.

...

Other parameters passed to sim_style_data.

Value

Returns a matrix of length reps with the following columns:

bias

alpha minus true

true

Response style-free alpha

alpha

Observed coefficient alpha

dep

Response style-dependent alpha, equal to bias

Further columns contain the input parameters such as the number of categories

See Also

The replicated function sim_style_data, covariate-free alpha alpha_cov


hplieninger/stylesim documentation built on May 17, 2019, 4:54 p.m.