EAPscores function

Compute Expected A Posteriori (EAP) scores

Compute Expected A Posteriori (EAP) scores

If you have missing data then you must specify minItemsPerScore. This option will set scores to NA when there are too few items to make an accurate score estimate. If you are using the scores as point estimates without considering the standard error then you should set minItemsPerScore as high as you can tolerate. This will increase the amount of missing data but scores will be more accurate. If you are carefully considering the standard errors of the scores then you can set minItemsPerScore to 1. This will mimic the behavior of most other IFA software wherein scores are estimated if there is at least 1 non-NA item for the score. However, it may make more sense to set minItemsPerScore to 0. When set to 0, all NA rows are scored to the prior distribution.

EAPscores(grp, ..., compressed = FALSE)

Arguments

  • grp: a list containing the model and data. See the details section.
  • ...: Not used. Forces remaining arguments to be specified by name.
  • compressed: output one score per observed data row even when freqColumn is set (default FALSE)

Details

Output is not affected by the presence of a weightColumn.

Format of a group

A model, or group within a model, is represented as a named list.

  • spec: list of response model objects
  • param: numeric matrix of item parameters
  • free: logical matrix of indicating which parameters are free (TRUE) or fixed (FALSE)
  • mean: numeric vector giving the mean of the latent distribution
  • cov: numeric matrix giving the covariance of the latent distribution
  • data: data.frame containing observed item responses, and optionally, weights and frequencies
  • score: factors scores with response patterns in rows
  • weightColumn: name of the data column containing the numeric row weights (optional)
  • freqColumn: name of the data column containing the integral row frequencies (optional)
  • qwidth: width of the quadrature expressed in Z units
  • qpoints: number of quadrature points
  • minItemsPerScore: minimum number of non-missing items when estimating factor scores

The param matrix stores items parameters by column. If a column has more rows than are required to fully specify a model then the extra rows are ignored. The order of the items in spec and order of columns in param are assumed to match. All items should have the same number of latent dimensions. Loadings on latent dimensions are given in the first few rows and can be named by setting rownames. Item names are assigned by param colnames.

Currently only a multivariate normal distribution is available, parameterized by the mean and cov. If mean and cov are not specified then a standard normal distribution is assumed. The quadrature consists of equally spaced points. For example, qwidth=2 and qpoints=5 would produce points -2, -1, 0, 1, and 2. The quadrature specification is part of the group and not passed as extra arguments for the sake of consistency. As currently implemented, OpenMx uses EAP scores to estimate latent distribution parameters. By default, the exact same EAP scores should be produced by EAPscores .

Examples

spec <- list() spec[1:3] <- list(rpf.grm(outcomes=3)) param <- sapply(spec, rpf.rparam) data <- rpf.sample(5, spec, param) colnames(param) <- colnames(data) grp <- list(spec=spec, param=param, data=data, minItemsPerScore=1L) EAPscores(grp)

See Also

Other scoring: bestToOmit(), itemOutcomeBySumScore(), observedSumScore(), omitItems(), omitMostMissing(), sumScoreEAP()