Skip to contents

[Stable] mar() performs multiple logistic regressions to test for MAR. The null hypothesis for each is that the data are not MAR.

Usage

mar(data, debug = FALSE)

Arguments

data

A data frame.

debug

A logical value used only for unit testing.

Value

A tibble::tibble():

missing

Column of M with missing data

p_value

Smallest p-value of the logistic regressions

explanatory

Variable corresponding to p_value

p_values

The p-values of the logistic regressions

variables

Variables corresponding to p_values

combined

Paired p_values and variables for easier interpretation

Details

In the following, each column of M with missing data is regressed on D_obs. Each regression produces a vector of p-values (one for each variable in D_obs). The smallest p-value is the most important. This is because missing data need only be dependent on one observed variable for the data to be MAR. If each reported smallest p-value is significant, the data is MAR. See vignette("background") for definitions of M and D_obs.

Examples

mar(healthcheck)
#> Warning: essentially perfect fit: summary may be unreliable
#> # A tibble: 1 × 6
#>   missing p_value explanatory p_values     variables    combined    
#>   <chr>     <dbl> <chr>       <named list> <named list> <named list>
#> 1 rbc     0.00188 age         <dbl [5]>    <chr [5]>    <dbl [5]>