rep_style_cor: 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 calculates a scale score (i.e., the mean across all items) for every person for every dimension. It mainly returns two values for every replication sample, namely, the observed correlation of the two scales as well as their partial correlation controlling for response style.

Usage

1
2
3
4
rep_style_cor(reps = 1000, n = c(100, 1000), items = c(5, 10),
  categ = c(3, 7), ndimc = 2, 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. Desired number of observations/persons.

items

Numeric. Desired number of items/stimuli. If ndimc > 1, this specifies the number of items per dimension.

categ

Numeric. Desired number of categories per item.

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. Indicates the number of reverse-coded items. Can be either a ratio between 0 and 1 indicating the ratio of reverse-coded items or an integer between 0 and items) indicating the number of reverse-coded items.

mu.s

Numeric. The mean(s) of the response style distribution.

var.s

Numeric. The variance(s) of the response style distribution.

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

obs minus partial

partial

The partial correlation r_{\bar{X}_1, \bar{X}_2 \cdot θ_{\textrm{RS}}}

obs

The observed correlation

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

See Also

sim_style_data


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