predict_style: Simulate Data Distorted by Response Style and Calculate, for...

Description Usage Arguments Value See Also

View source: R/fun_replicate-simulation-for-roc.R

Description

This function repeatedly simulates data that are distorted by response style. It makes use of the scale scores \bar{X}—which are influenced by both the attribute and response style—as well as the true person parameters θ_1, that is, the persons' standing on the attribute, which is unaffected by response style. These two scores are used to classify each individual at certain cutoff values as either above (i.e., positive) or below (i.e., negative) the cutoff. Subsequently, the true positive rate (TPR), the false positive rate (FPR), the precision, and the accuracy are calculated at every cutoff value.

Usage

1
2
3
predict_style(reps = 100, n = 200, items = 10, categ = 5, ndimc = 1,
  style = NULL, reversed = 1/3, mu.s = 0, var.s, sig = NULL,
  emp = TRUE, cutoff, ...)

Arguments

reps

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.

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.

cutoff

Optional numeric vector. Desired cutoff- (alpha-) values at which to calculate TPR, FPR, etc; probably a sequence, for example from .95 to .05 (must be within the open interval of (0, 1))

...

Other parameters passed to sim_style_data.

Value

alpha

The cutoff-/alpha-values

TPR

True positive rate

FPR

False positive rate

PREC

Precision

ACC

Accuracy

Further elements containing the input parameters

See Also

The replicated function sim_style_data.


hplieninger/stylesim documentation built on May 16, 2017, 12:57 a.m.