MCAR test error (from naniar package): problem with mutate and"conditional number"

812 views Asked by At

I'm working with some time series data frames in R (I have 166 df in a list) and almost all of them has aprox 20% of NA's (each of the df has 8760 observations). So, I'm running the test on MCAR for the missing values in order to assess the correct procedure. For that, I used the package naniar and the function mcar_test() for each of the df to see the p-value and determine if the NA's where MCAR or MAR.

The tests run correctly on almost all of the df, but a handfull gives me some errors:

>  mcar_test(df_list[[86]])
Error: Problem with `mutate()` column `d2`.
i `d2 = purrr::pmap_dbl(...)`.
x system is computationally singular: reciprocal condition number = 1.93262e-16
i The error occurred in group 15: miss_pattern = 15.

This is the head of this particular df (if it's any use):

> head(df_list[[86]])
# A tibble: 6 x 9
  Date                 CHO   CUA   PED   SFE
  <dttm>              <dbl> <dbl> <dbl> <dbl>
1 2012-01-01 00:00:00   1.3    NA   0.4    NA
2 2012-01-01 00:00:00   1.6    NA   0.9    NA
3 2012-01-01 00:00:00   1.8    NA   1.2    NA
4 2012-01-01 00:00:00   2.6    NA   1.2    NA
5 2012-01-01 00:00:00   2.2    NA   1.3    NA
6 2012-01-01 00:00:00   1.8    NA   1.2    NA
# ... with 4 more variables: TAH <dbl>,
#   TPN <dbl>, UAX <dbl>, UIZ <dbl>

The df is essentially the same as the rest (of course, with different values), so nothing unusual, as far as I can tell. Any idea what's causing that error?

0

There are 0 answers