| stepwiseIt | R Documentation | 
This function eliminates items stepwise according to one of the following criteria: itemfit, Wald test, Andersen's LR-test
## S3 method for class 'eRm'
stepwiseIt(object, criterion = list("itemfit"), alpha = 0.05,
           verbose = TRUE, maxstep = NA)
| object | Object of class  | 
| criterion | List with either  | 
| alpha | Significance level. | 
| verbose | If  | 
| maxstep | Maximum number of elimination steps. If  | 
If criterion = list("itemfit") the elimination stops when none of the p-values 
in itemfit is significant. Within each step the item with the largest chi-squared 
itemfit value is excluded.
If criterion = list("Waldtest") the elimination stops when none of the p-values 
resulting from the Wald test is significant. Within each step the item with the largest z-value in 
Wald test is excluded. 
If criterion = list("LRtest") the elimination stops when Andersen's LR-test is not
significant. Within each step the item with the largest z-value in Wald test is excluded. 
The function returns an object of class step containing:
| X | Reduced data matrix (bad items eliminated) | 
| fit | Object of class  | 
| it.elim | Vector contaning the names of the eliminated items | 
| res.wald | Elimination results for Wald test criterion | 
| res.itemfit | Elimination results for itemfit criterion | 
| res.LR | Elimination results for LR-test criterion | 
| nsteps | Number of elimination steps | 
LRtest.Rm, Waldtest.Rm, itemfit.ppar
## 2pl-data, 100 persons, 10 items
set.seed(123)
X <- sim.2pl(500, 10, 0.4)
res <- RM(X)
## elimination according to itemfit
stepwiseIt(res, criterion = list("itemfit"))      
## Wald test based on mean splitting
stepwiseIt(res, criterion = list("Waldtest","mean")) 
## Andersen LR-test based on random split
set.seed(123)
groupvec <- sample(1:3, 500, replace = TRUE)
stepwiseIt(res, criterion = list("LRtest",groupvec))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.