grm {pairwise} | R Documentation |
Graphical Model Check
Description
This function makes the basic calculations for the graphical model check for dicho- or polytomous item response formats. It is more or less a wraper function, internaly calling the function pairSE
. Several splitting options are available (see arguments).
Usage
grm(
daten,
m = NULL,
w = NULL,
split = "random",
splitseed = "no",
verbose = FALSE,
...
)
Arguments
daten |
a data.frame or matrix with optionaly named colums (names of items), potentially with missing values, comprising polytomous or dichotomous (or mixed category numbers) responses of |
m |
an integer (will be recycled to a vector of length k) or a vector giving the number of response categories for all items - by default |
w |
an optional vector of case weights. |
split |
Specifies the splitting criterion. Basically there are three different options available - each with several modes - which are controlled by passing the corresponding character expression to the argument. 1) Using the rawscore for splitting into subsamples with the following modes: 2) Dividing the persons in 3) The third option is using a manifest variable as a splitting criterion. In this case a vector with the same length as number of cases in |
splitseed |
numeric, used for |
verbose |
logical, if |
... |
additional arguments |
Details
The data is splitted in two or more subsamples and then item thresholds, the parameter (Sigma) and their standard errors (SE) for the items according the PCM are calculated for each subsample. Additional arguments (see description of function pairSE
) for parameter calculation are passed through.
WARNING: When using data based on booklet designs with systematically missing values (by design) you have to ensure that in each of the booklet the maximum raw value to reach is equal while using the raw value as splitting criterion.
Value
A (list) object of class c("grm","list")
containing the item difficulty parameter sigma and their standard errors for two or more subsamples.
A note on standard errors
Estimation of standard errors is done by repeated calculation of item parameters for subsamples of the given data. This procedure is mainly controlled by the arguments nsample
and size
(see arguments). With regard to calculation time, the argument nsample
is the 'time killer'. On the other hand, things (estimation of standard errors) will not necessarily get better when choosing large values for nsample
. For example choosing nsample=400
will only result in minimal change for standard error estimation in comparison to (nsample=30
) which is the default setting (see examples).
References
description of function pairSE
{pairwise}
.
Examples
data(bfiN) # loading example data set
data(bfi_cov) # loading covariates to bfiN data set
# calculating itemparameters and SE for two random allocated subsamples
grm_gen <- grm(daten=bfiN, split = bfi_cov$gender)
summary(grm_gen)
#### plot(grm_gen)
grm_med <- grm(daten=bfiN, split = "median")
summary(grm_med)
#### plot(grm_med)
grm_ran<-grm(daten=bfiN, split = "random")
summary(grm_ran)
# some examples for plotting options
# plotting item difficulties for two subsamples against each other
# with elipses for a CI = 95% .
#### plot(grm_ran)
# using triangles as plotting pattern
#### plot(grm_ran,pch=2)
#plotting without CI ellipses
#### plot(grm_ran,ci=0,pch=2)
# plotting with item names
#### plot(grm_ran,itemNames=TRUE)
# Changing the size of the item names
#### plot(grm_ran,itemNames=TRUE, cex.names = 1.3)
# Changing the color of the CI ellipses
plot(grm_ran,itemNames=TRUE, cex.names = .8, col.error="green")
###### example from details section 'Some Notes on Standard Errors' ########
## Not run:
grm_def<-grm(daten=bfiN, split = "random",splitseed=13)
plot(grm_def)
######
grm_400<-grm(daten=bfiN, split = "random", splitseed=13 ,nsample=400)
plot(grm_400)
## End(Not run)