If someone were to ignore the function documentation and just ran the mcar() function on a dataset with one missing data pattern, the error message would be:
Error in mcar.data.frame(popmis2) : object 'idpats' not found.
It may be nice to make this more informative by adding the following to the mcar() function:
if(nrow(pats) < 4L){
stop("This MCAR test requires two or more missing data patterns.")
}
If someone were to ignore the function documentation and just ran the
mcar()
function on a dataset with one missing data pattern, the error message would be:It may be nice to make this more informative by adding the following to the
mcar()
function:@cjvanlissa Do you think that would make sense?