{'fraction_non_alphanumeric': 0.012216404886561954, 'fraction_numerical': 0.0, 'mean_word_length': 5.18705035971223, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The score test for the two‐sample occupancy model

The score test statistic from the observed information is easy to compute numerically. Its large sample distribution under the null hypothesis is well known and is equivalent to that of the score test based on the expected information, the likelihood‐ratio test and the Wald test. However, several authors have noted that under the alternative hypothesis this no longer holds and in particular the score statistic from the observed information can take negative values. We extend the anthology on the score test to a problem of interest in ecology when studying species occurrence. This is the comparison of two zero‐inflated binomial random variables from two independent samples under imperfect detection. An analysis of eigenvalues associated with the score test in this setting assists in understanding why using the observed information matrix in the score test can be problematic. We demonstrate through a combination of simulations and theoretical analysis that the power of the score test calculated under the observed information decreases as the populations being compared become more dissimilar. In particular, the score test based on the observed information is inconsistent. Finally, we propose a modified rule that rejects the null hypothesis when the score statistic is computed using the observed information is negative or is larger than the usual chi‐square cut‐off. In simulations in our setting this has power that is comparable to the Wald and likelihood ratio tests and consistency is largely restored. Our new test is easy to use and inference is possible. Supplementary material for this article is available online as per journal instructions.