Replies: 2 comments
-
@cjvanlissa Could you take a look at this? |
Beta Was this translation helpful? Give feedback.
-
By the way, for the default value of 6 for min_n, see,
I thought it was derived from this statement, is this perception incorrect? (I couldn't understand why it was 6, though.) By the way, if I make min_n smaller (trying to get the MCAR test done with all the data), I will get the following error. library(mice)
#>
#> Attaching package: 'mice'
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following objects are masked from 'package:base':
#>
#> cbind, rbind
mcar(airquality, min_n = 1)
#>
#> iter imp variable
#> 1 1 Ozone Solar.R
#> 1 2 Ozone Solar.R
#> 1 3 Ozone Solar.R
#> 1 4 Ozone Solar.R
#> 1 5 Ozone Solar.R
#> 2 1 Ozone Solar.R
#> 2 2 Ozone Solar.R
#> 2 3 Ozone Solar.R
#> 2 4 Ozone Solar.R
#> 2 5 Ozone Solar.R
#> 3 1 Ozone Solar.R
#> 3 2 Ozone Solar.R
#> 3 3 Ozone Solar.R
#> 3 4 Ozone Solar.R
#> 3 5 Ozone Solar.R
#> 4 1 Ozone Solar.R
#> 4 2 Ozone Solar.R
#> 4 3 Ozone Solar.R
#> 4 4 Ozone Solar.R
#> 4 5 Ozone Solar.R
#> 5 1 Ozone Solar.R
#> 5 2 Ozone Solar.R
#> 5 3 Ozone Solar.R
#> 5 4 Ozone Solar.R
#> 5 5 Ozone Solar.R
#> Error in mcar.data.frame(airquality, min_n = 1): object 'idpats' not found Created on 2023-12-01 with reprex v2.0.2 I think this is due to the following part of the mcar() code; remove_pats <- as.numeric(rownames(pats))[-nrow(pats)] <= min_n
if (any(remove_pats)) {
# omission
idpats <- do.call(paste, as.data.frame(pats == 0))
# omission
}
# omission
idpats <- idpats[!remove_pats] I thought this was because idpats assumes that some data will be deleted, and if it is not deleted, it is trying to define idpats using idpats that do not exist yet. Is this due to some statistical reason that this process should always delete more than 1 pattern of data? However, this seems somewhat inconsistent with the fact that min_n accepts 1. (Incidentally, I checked the behavior of MissMech::TestMCARNormality(), which is described in the documentation as the source of the re-implementation, and this one was able to perform the mcar test using all data. I could not determine which process was more valid.) |
Beta Was this translation helpful? Give feedback.
-
When I submit data with missing values to the mcar() function of the mice package, the message "No need for mice. This data set is completely observed." is sometimes displayed.
For example, if you submit missvals data from the mvnmle package, you will get the following message.
Created on 2023-11-29 with reprex v2.0.2
This "No need for mice. This data set is completely observed." seems to be in the md.pattern() function, but when I submit missvals from the mvnmle package to md.pattern(), this message does not appear.Is there a way around this message?After reading the source code, I found that this message problem can be resolved by setting min_n to less than the default value of 6.
Created on 2023-11-29 with reprex v2.0.2
How should I go about setting a statistically reasonable value for this min_n? Can it be reduced until the message is resolved and a solution is obtained, as in this case?
Beta Was this translation helpful? Give feedback.
All reactions