checkMIS: Function to check/report missing values in paired comparison...

View source: R/checkMIS.R

checkMISR Documentation

Function to check/report missing values in paired comparison studies

Description

For a given paired comparisons data set the function calculates and prints the number of missing comparisons and the number of times objects are missing. It can also be used to avoid failure of nonresponse-parameter for nonresponse models in

Usage


checkMIS(obj, nitems, MISmodel = "obj", obj.names = NULL, verbose = FALSE)

Arguments

obj

dataframe or datafile path/name (like pattPC.fit).

nitems

the number of compared objects, not the number of comparisons (like pattPC.fit).

MISmodel

specifies the nonresponse model, either obj (default) for missing mechanisms based on objects, or comp based on comparisons. This argument is only relevant for the (invisible) output of checkMIS.

obj.names

character vector with names for objects.

verbose

if TRUE printed output, otherwise only invisible output to be used, e.g., in the specification of MISalpha and MISbeta in pattPC.fit.

Value

a logical vector (returned invisibly) specifying for which object/comparison there are NA responses in the data (obj).

See Also

pattPC.fit

Examples

# no missing NAs in dataset dat4
checkMIS(dat4, nitems = 4, verbose = TRUE)

# generates data set with three items and some missing values in
# comparison (23), column 3, then there are no NAs for object 1
data3 <- dat4[, 1:3]
idx3  <- sample(1:100, 10)
data3[idx3, 3] <- NA
checkMIS(data3, nitems = 3, verbose = TRUE)

# estimate MCAR PC pattern model for data3 with NA indicators alpha1
# cannot be estimated being accommodated by using checkMIS
pattPC.fit(data3, nitems = 3, MISalpha = checkMIS(data3, nitems = 3))

prefmod documentation built on Sept. 30, 2023, 5:06 p.m.