Learn R Programming

fwdmsa (version 0.2)

fs.MSA: Forward Search for Mokken Scale Analysis

Description

Computes the necessary input for forward plots for Mokken scale analysis

Usage

fs.MSA(
 X, 
 initial.subsample = "random", 
 initial.subsample.size = default.initial.subsample.size, 
 minsize = default.minsize, 
 seed = default.seed,
 n.low = default.n.low,  
 verbose = TRUE)

Arguments

X
Matrix or data frame of numeric data containing the responses of nrow(X) respondents to ncol(X) items. Each row is called an observation. Each item has $m+1$ response options $0, \ldots, m$. Othe
initial.subsample
Default is "random". Otherwise, a vector containing the rows of X that make up the initial subsample.
initial.subsample.size
Integer giving the size of the initial subsample. Only effective if initial.subsample="random". By default initial.subsample.size equals the minimum of the numbe
minsize
Integer giving the minimum size of a rest score group. By default minsize = $N/10$ if $N \ge 500$; minsize = $N/5$ if $250 \le N < 500$; and minsize = max$(N/3,50)$ if $N < 250$
seed
Numeric; fixes the random number generation set.seed in order to control the initial subsample. Default is a randomly drawn value between 1 and 10000.
n.low
Numeric; $n2$ should be larger than n.low. Default n.low = N/4.
verbose
Logical, indicating whether the subsample size should be printed on the screen. If FALSE, no output is produced. The default is TRUE.

Value

  • Object of class fs.class containing the required input for forward plots (plot.fs.class). Only few of the items are of direct interest: initial.subsample.size. Shows $n0$. n2. Shows $n2$. suspect. Shows the suspect observations. order.objective.function. Shows the observations in descending order of their objective function values, for each subsample. Hence, the element row 1 and column 189 is the most suspect observation given the subsample of size 189.

Details

Function fs.MSA computes the required input for forward plots (plot.fs.class). Therefore, its values should be assigned to an object. Function fs.MSA may take a long time for data if the number of items and/or observations is large. A large initial.subsample.size reduces the computation time but may affect the results.

References

Zijlstra, W. P., Van der Ark, L. A., and Sijtsma, K. (2011). Robust Mokken scale analysis by means of the forward search algorithm for outlier detection. Multivariate Behavioral Research, 46, 58-89. Van der Ark, L. A. (2007). Mokken scale analysis in R. Journal of Statistical Software. http://www.jstatsoft.org

See Also

fs.MSA.n1, plot.fs.class, plot.fs.n1.class

Examples

Run this code
# Retrieve data (588 observations)
  data(acs)

# Run Forward Search for Mokken scale analysis starting with
# 550 observations in the initial subsample size to save time
  fwdmsa.res <- fs.MSA(acs, initial.subsample.size=550)

# Plot the objective function
  plot(fwdmsa.res, xlim = c(540,588))

# Plot the objective function for observations 1, 2, and 4
  plot(fwdmsa.res, id.observation = c(1,2,4), add=TRUE, col=2, xlim = c(540,588))

# Gap plot for subsamples 570 through 588
  plot(fwdmsa.res, type = "gap", ylim = c(0,4), xlim = c(570,588))

# Follow-up plots
  plot(fwdmsa.res, type="followup", step=560:565, reference.step=560, xlim = c(540,588))

# Min-excl plot.
  plot(fwdmsa.res, type = "minexcl", n2=TRUE, xlim=c(540,588))

# Plot of number of scales
  plot(fwdmsa.res, type="num.scale", n2=TRUE, xlim=c(540,588))

# Item entry plot for the longest scale
  plot(fwdmsa.res, type="scale", id.scale=1, n2=TRUE, xlim=c(540,588))

# Plot of estimated IRF of item 1
  plot(fwdmsa.res, type="IRF", items=1, n2=TRUE, xlim=c(540,588))

# Plot of coefH
  plot(fwdmsa.res, type="coefH", n2=TRUE, ylim=c(.1,.8), xlim=c(540,588))

Run the code above in your browser using DataLab