PPass: Person Assessment function

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PPass.R

Description

Estimate Person Paramters and calculate Person Fit in one step to gain resonse pattern assessment. Submit a data.frame which contains item responses, or an fitted model (Rasch Model and Partial Credit Model are supported) of the eRm package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
PPass(...)

## Default S3 method:
PPass(
  respdf,
  items = "all",
  mod = c("1PL", "2PL", "3PL", "4PL", "PCM", "GPCM", "MIXED"),
  fitindices = c("lz", "lzstar", "infit", "outfit"),
  ...
)

## S3 method for class 'Rm'
PPass(RMobj, fitindices = c("lz", "lzstar", "infit", "outfit"), ...)

Arguments

respdf

A data.frame which contains the items, and perhaps other informations. Each row is a person related resonse patter. Each column denotes a variable.

items

A numeric (integer) vector which indicates the positions of the items in the data.frame (respdf). If items = 'all', all columns are treated as items.

mod

Choose your data generating model. This argument switches between the three person parameter estimating functions PP_4pl, PP_gpcm and PPall.

fitindices

A character vector which denotes the fit indices to compute.

RMobj

A fitted Rasch Model (RM()) object which stems from the eRm package.

...

Submit arguments to the underlying functions: PP_4pl, PP_gpcm and PPall (see documentation files) for person parameter estimation.

Details

PPass fuses Person Parameter estimation and Person Fit computation into a single function.

Value

The original data.frame and

Author(s)

Manuel Reif, Jan Steinfeld

See Also

PP_4pl, PP_gpcm, PPall, Pfit

Examples

 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
library(eRm)
### real data ##########

data(pp_amt)

d <- pp_amt$daten_amt

rd_res <- PPass(respdf = d, 
                items = 8:ncol(d),
                mod="1PL",
                thres = pp_amt$betas[,2], 
                fitindices = "lz")

head(rd_res)


## ========== RM - eRm 
my_data <- eRm::sim.rasch(200, 12)
my_rm <- eRm::RM(my_data)

res_pp1 <- PPass(my_rm)


## ========== PCM - eRm

set.seed(2751)

THRES  <- matrix(c(-2,-1.23,1.11,3.48,1
                   ,2,-1,-0.2,0.5,1.3,-0.8,1.5),nrow=2)
THRES <- rbind(THRES,c(-0.2,NA,NA,NA,NA,NA))

sl          <- rep(1,6)
THRESx      <- rbind(0,THRES)
THETA       <- rnorm(200)
simdat_gpcm <- sim_gpcm(thres = THRESx,alpha = sl,theta = THETA)

my_pcm <- eRm::PCM(simdat_gpcm)

res_pp2 <- PPass(my_pcm)

## ==========  1PL model

set.seed(1337)

# intercepts
diffpar <- seq(-3,3,length=15)
# slope parameters
sl     <- round(runif(15,0.5,1.5),2)
la     <- round(runif(15,0,0.25),2)
ua     <- round(runif(15,0.8,1),2)

# response matrix
awm <- matrix(sample(0:1,100*15,replace=TRUE),ncol=15)
awm <- as.data.frame(awm)
# estimate person parameter

# estimate person parameter and person fit
out <- PPass(respdf = awm,thres = diffpar, items="all",
             mod=c("1PL"), fitindices= c("lz","lzstar","infit","outfit"))

# show first rows
head(out)

manuelreif/PP documentation built on May 31, 2021, 11:23 p.m.