Learn R Programming

fwdmsa (version 0.2)

plot.fs.class: Plot fs.class objects

Description

S3 Method to plot objects of class fs.class. Graphic display of the robust Mokken scale analysis by means of the Forward Search. Seven different plots can be obtained.

Usage

"plot"( x, type = "objective", observations = all.observations, id.observation = FALSE, items = all.items, id.item = FALSE, step = default.step, reference.step = default.reference.step, id.scale = default.scale, tukey.fences = TRUE, add = FALSE, n0 = FALSE, n1 = FALSE, n2 = FALSE, lower.c = default.lower.c, col = default.col, lwd = default.lwd, lty = default.lty, ylim = default.ylim, xlim = default.xlim, ...)

Arguments

x
Object of class fs.class produced by fs.MSA.
type
Type of forward plot: "objective" (default): Forward plot showing the objective function for an observation over all subsample sizes. "minexcl": Forward plot of the minimum objective function values of the observations exluded from the sample. "maxincl": Forward plot of the maximum objective function values of the observations included in the sample. "gap": Forward plot of the minexcl-maxincl. "coefH": Forward plot of Loevinger's scalability coefficient for items ($Hj$) and the test ($H$). "restscore": One graph for each item plotting the estimated expected item response functions. "IRF": Forward plot of the estimated expected item response functions. "followup": Forward plot of the observations entering and leaving the subsample at a specified step. The identitty of the obervations entering or leavind the subsample is provided in the plot. "scale": Forward plot showing whether the selected items belong to a scale. "num.scale": Forward plot of the number of scales found by the AISP.
observations
Vector containing the observations to show. The default uses all observations. Relevant for type="objective".
id.observation
Vector containing the observation(s) for which the results are plotted in a different color and the identity of the observation(s) is added to the plot. Relevant for type="objective".
items
Vector containing the items for which the results are plotted. Default the results for all items are depicted. Relevant for type="coefH", type="restscore", type="IRF", and type="scale".
id.item
Logical, if TRUE the identity of the items are added to the plot. Relevant for type="coefH".
step
Single number or vector containing the subsample size. Default is sample size $N$. For type="restscore" step is a single number. For type="individual" step may be a vector. Relevant for type="restscore" and type="individual".
reference.step
Single number containing the subsample size. Default is step-1. Relevant for type="individual".
id.scale
Numeric indicating which scale to show; id.scale=0 indicates unscalable items, id.scale=1 indicates the longest scale, id.scale=2 indicates the next longest scale, etc. Default shows all scales. Relevant for type="scale".
tukey.fences
Logical, if TRUE Tukey's Fences (Q3 + 1.5 * IQR and Q3 + 3 * IQR) are plotted. Relevant for type="minexcl".
add
Logical, if TRUE, the plot is added to the current plot. The default is FALSE. Relevant for type="objective", type="minexcl", type="maxincl", type="gap", type="coefH", and type="restscore".
n0
Logical, indicating whether $n0$ should be added to the plots. Default is FALSE
n1
Default is FALSE otherwise a single number should be given
n2
Logical, indicating whether $n2$ should be added to the plots. Default is FALSE
lower.c
Numeric scaling criterium; 0 <= lowerbound < 1. The default is 0.3.
col
Colour to be used for the lines.
lwd
Line width
lty
Line type
ylim, xlim
Range of x and y values with sensible defaults.
...
Other arguments are ignored.

Value

Returns a graph.

Details

add=TRUE for type="restscore" can only be used for one item (e.g., items=1).

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.

See Also

fs.MSA, fs.MSA.n1, 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