Description Details Author(s) References Examples
The package conducts the Forward Search on test and questionnaire data, and shows forward plots for the detection of outliers.
Package: | fwdmsa |
Type: | Package |
Version: | 0.2 |
Date: | 2011-07-26 |
License: | GPL Version 2 or later |
The package includes the functions
fs.MSA | Computes the necessary input for forward plots |
plot.fs.class | S3 method for forward plots |
fs.MSA.n1 | Computes n1 |
plot.fs.n1.class | S3 method for a plot showing graphically n1 |
and data set
acs | Autonomy-Connectedness Scale |
Thanks are due to L. Andries van der Ark for contributing R code, and Marrie Bekker and Marcel van Assen for providing the data set.
Wobbe P. Zijlstra Maintainer: Wobbe P. Zijlstra <w.p.zijlstra@uvt.nl>.
Bekker M. H. J., and Van Assen, M. A. L. M. (2006). A short form of the autonomy scale: Properties of the autonomy-connectedness scale (ACS-30). Journal of Personality Assessment, 86, 51-60.
Van der Ark, L. A. (2007). Mokken scale analysis in R. Journal of Statistical Software. http://www.jstatsoft.org
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | ## Not run:
## Analyses of Zijlstra et al. (2010).
## First Forward Search Analysis
library(fwdmsa)
data(acs.cont)
# Determining n1 = 292
# Takes approximately 40 minutes
fs1.1.n1 <- fs.MSA.n1(acs.cont, B=100)
n1 <- fs1.1.n1$n1
# Figure 2: Plot of number unique subsamples
plot(fs1.1.n1)
# Running the forward search
fs1.1 <- fs.MSA(acs.cont)
# Figure 3: Plot of objective function
plot(fs1.1, type="objective", observations=1:618, col="gray70", n0=TRUE, n1=fs.res.cont.n1$n1, xlim=c(0,650))
plot(fs1.1, type="objective", id.observation=619, col=1, lwd=2, lty=2, add=TRUE)
plot(fs1.1, type="objective", observations=589:618, lwd=2, add=TRUE)
# Figure 4: Gap plot
plot(fs1.1, type="gap", ylim=c(-10,12), n0=TRUE, n1=292)
# Figure 5: Follow-up plots
plot(fs1.1, type="followup", step=543:548, reference.step=543, n0=TRUE, n1=292)
## Remove influential observations from the data
acs.sus <- acs.cont[-(589:618),]
# Determining n1 = 296
fs1.2.n1 <- fs.MSA.n1(acs.sus, B=100)
n1 <- fs1.2.n1$n1
# Running the forward search
fs1.2 <- fs.MSA(acs.sus)
# Figure 6: Minexcl plot
plot(fs1.2, type="minexcl", n0=TRUE, n1=296, n2=TRUE)
# Figure 7: Plot of number of scales
plot(fs1.2, type="num.scale", n0=TRUE, n1=296, n2=TRUE)
# Figure 8: Item entry plot for the longest scale
plot(fs1.2, type="scale", id.scale=1, n0=TRUE, n1=296, n2=TRUE)
## Second Forward Search Analysis
# Remove bad items from the data
acs.min.core <- acs.cont[-(589:618),-c(3,7,8,11,13,16)]
# Determining n1 = 302
fs2.n1 <- fs.MSA.n1(acs.min.core, B=100)
n1 <- fs2.1.n1$n1
# Running the forward search
fs2 <- fs.MSA(acs.min.core)
# Figure 9: Plot of restscore regression of item 1 for steps 302 and 589
plot(fs2, type="restscore", step=302, items=1, lty=2, ylim=c(0,4), n0=TRUE, n1=302, n2=TRUE)
plot(fs2, type="restscore", step=589, items=1, lty=1, add=TRUE)
# Figure 10: Plot of estimated IRF of item 1
plot(fs2, type="IRF", items=1, n0=TRUE, n1=302, n2=TRUE)
# Figure 11: Plot of coefH
plot(fs2, type="coefH", n0=TRUE, n1=302, n2=TRUE, ylim=c(.1,.8))
## What if influential observations were not removed from the data
acs.cont.core <- acs.cont[,-c(3,7,8,11,13,16)]
# Determining n1 = 347
fs3.n1 <- fs.MSA.n1(acs.cont.core, B=100)
n1 <- fs3.n1$n1
# Running the forward search
fs3 <- fs.MSA(acs.cont.core)
# Figure 12a: Plot of estimated IRF of item 1 with influential observations
plot(fs3, type="IRF", items=1, n0=TRUE, n1=347, n2=FALSE)
# Figure 12b: Plot of coefH with influential observations
plot(fs3, type="coefH", n0=TRUE, n1=347, n2=FALSE, ylim=c(.1,.8))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.