|
72 | 72 | ) |
73 | 73 | plt.xlabel("Column 1") |
74 | 74 | plt.ylabel("Column 2") |
75 | | -plt.title("Case 1: MCAR missingness mechanism") |
| 75 | +plt.title("Case 1: MCAR data") |
76 | 76 | plt.grid() |
77 | 77 | plt.show() |
78 | 78 |
|
79 | 79 | # %% |
80 | 80 | result = test_mcar.test(df_nan) |
81 | 81 | print(f"Test p-value: {result:.2%}") |
82 | 82 | # %% |
83 | | -# The p-value is quite high, therefore we don't reject H0. |
84 | | -# We can then suppose that our missingness mechanism is MCAR. |
| 83 | +# The p-value is larger than 0.05, therefore we don't reject the HO MCAR assumption. In this case |
| 84 | +# this is a true negative. |
85 | 85 |
|
86 | 86 | # %% |
87 | 87 | # Case 2: MAR holes with mean bias (True positive) |
|
104 | 104 | ) |
105 | 105 | plt.xlabel("Column 1") |
106 | 106 | plt.ylabel("Column 2") |
107 | | -plt.title("Case 2: MAR missingness mechanism") |
| 107 | +plt.title("Case 2: MAR data with mean bias") |
108 | 108 | plt.grid() |
109 | 109 | plt.show() |
110 | 110 |
|
|
113 | 113 | result = test_mcar.test(df_nan) |
114 | 114 | print(f"Test p-value: {result:.2%}") |
115 | 115 | # %% |
116 | | -# The p-value is lower than the classic threshold (5%). |
117 | | -# H0 is then rejected and we can suppose that our missingness mechanism is MAR. |
| 116 | +# The p-value is smaller than 0.05, therefore we reject the HO MCAR assumption. In this case |
| 117 | +# this is a true positive. |
118 | 118 |
|
119 | 119 | # %% |
120 | 120 | # Case 3: MAR holes with any mean bias (False negative) |
|
143 | 143 | ) |
144 | 144 | plt.xlabel("Column 1") |
145 | 145 | plt.ylabel("Column 2") |
146 | | -plt.title("Case 3: MAR missingness mechanism undetected by the Little's test") |
| 146 | +plt.title("Case 3: MAR data without any mean bias") |
147 | 147 | plt.grid() |
148 | 148 | plt.show() |
149 | 149 |
|
|
152 | 152 | result = test_mcar.test(df_nan) |
153 | 153 | print(f"Test p-value: {result:.2%}") |
154 | 154 | # %% |
155 | | -# The p-value is higher than the classic threshold (5%). |
156 | | -# H0 is not rejected whereas the missingness mechanism is clearly MAR. |
| 155 | +# The p-value is larger than 0.05, therefore we don't reject the HO MCAR assumption. In this case |
| 156 | +# this is a false negative since the missingness mechanism is MAR. |
157 | 157 |
|
158 | 158 | # %% |
159 | 159 | # Limitations |
|
0 commit comments