error.check: Checks for basic errors in input to the 'ple.lma' function

Description Usage Arguments Value Examples

View source: R/error_check.R

Description

This functions looks at the input to the main function (ple.lma) and checks for 11 different possible errors. If an error is detected, the function issues a warning and stops any further execution. This funcion is internal to 'ple.lma' but can be used outside of the wrapper function.

Usage

1
error.check(inData, model.type, inTraitAdj = NULL, inItemTraitAdj = NULL)

Arguments

inData

Data frame with columns corresponding to categorical variables and rows to the number of cases

model.type

Type of model that will be fit to data

inTraitAdj

Trait x Trait adjacency matrix (not required for independence)

inItemTraitAdj

Item x Trait adjacency matrix (not required for independence)

Value

Message whether error was detected in input, and if so the nature of the error

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 #--- some data
 data(dass)
 inData <- dass[1:250,c("d1", "d2", "d3", "a1","a2","a3","s1","s2","s3")]

 #--- no errors
 error.check(inData, model.type="independence")

 #--- for unidimensional
 inTraitAdj  <- matrix(1, nrow=1, ncol=1)
 inItemTraitAdj <- matrix(1, nrow=9, ncol=1)

 #--- no errors
 error.check(inData, model.type="rasch", inTraitAdj, inItemTraitAdj)
 error.check(inData, model.type="gpcm", inTraitAdj, inItemTraitAdj)
 error.check(inData, model.type="nominal", inTraitAdj, inItemTraitAdj)

pleLMA documentation built on Oct. 6, 2021, 1:08 a.m.