View source: R/LittleMCAR_test.R
LittleMCAR_test | R Documentation |
Use Little's (1988) test statistic to assess if data is missing completely at random (MCAR). The null hypothesis in this test is that the data is MCAR, and the test statistic is a chi-squared value.
In the mlest()
function of the mvnmle
package, the correct statistics could not be calculated because the solution of ML estimation may not converge with the default value.
Using a modified version of the mlest2()
function, an algorithm is used to perform ML estimation until the solution converges.
LittleMCAR_test(data, ...)
data |
A data frame |
... |
Arguments passed on to
|
If stop.code
is 4
, the solution of maximum likelihood estimation has not converged at the upper limit of the number of calculations set by max_iterlim
;
change max_iterlim
and recalculate with an increased upper limit.
A list with class "htest"
containing the following components:
statistic |
Chi-square value. |
parameter |
Degrees of freedom used for chi-square. |
p.value |
the p-value for the test. |
method |
a character string indicating the type of test performed. |
data.name |
a character string giving the name of the data. |
missing.patterns |
Number of missing data patterns. |
amount.missing |
Amount and percent of mssing data. |
data |
The data, organized my missing data patterns. |
stop.code |
The stop code returned by |
iterations |
The number of iterations used by |
Code is adapted from mcar_test
in naniar
package.
mlest2
LittleMCAR_test(airquality)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.