mcar_test: mcar_test

Description Usage Arguments Format Details Thankyous Warning

View source: R/mcar_test.R


mcar_test evaluates differences in expected mean or count according to a specified missing/non missing variable


mcar_test(data, y, factor.list)



Dataset you are using.


The variable that you want to split the dataset into two parts dependent upon the missingness. This must be in quotes. E.g., "C1"


Those variables that are factors. Must be in quotes. E.g., c("F1", "F2")


Gives 4 dataframes: mcar.t.test.table - the results from the t-test mcar.chi2.table mcar.chi2.results - the results from the chi2 test mcar.chi2.ctab - the contingency table


Prior to identifying structure in the data, it is useful to ask whether there is sufficient missingness to warrant such an investigation - and to try and determine whether the data is missing completely at random (MCAR). This can be done by splitting the data into two groups according to the presence or absence of a selected dependent variable, and to apply a t-test if the independent variables are continuous or a chi-square test if they are discrete, in order to determine equality of the means or the category probabilities, respectively. A Bonferroni adjustment (or similar) method can be used to allow for multiple tests. This mcar_test is based off of the test for whether data is completely missing at random, from Little(1988)


Special thanks to Dr. Nicole White for her help writing the initial code in early 2013


the data must contain only numerical values - No strings!

njtierney/mex documentation built on May 23, 2017, 3:45 p.m.