Skip to contents

The variance is evaluated at the NULL p0, not at the estimate, which is why the score test still works when phat is 0 or 1.

Usage

Scoretest(successes, n, p0 = 0.5)

Arguments

successes

Number of successes S.

n

Number of trials.

p0

Null proportion, strictly between 0 and 1.

Value

List with statistic, chisq, p_value, estimate, se_null, n.

Details

Formula: U = (S - n p0) / sqrt(n p0 (1 - p0)); U^2 ~ chi^2_1; p = 2(1 - Phi(|U|))

References

Rao (1948), Mathematical Proceedings of the Cambridge Philosophical Society 44(1), 50-57 – the primary source for the score test. Wasserman (2004), All of Statistics, does not give the score test, so it is not cited for this formula.

Examples

Scoretest(successes = 5L, n = 5L)
#> $statistic
#> [1] 2.236068
#> 
#> $chisq
#> [1] 5
#> 
#> $p_value
#> [1] 0.02534732
#> 
#> $estimate
#> [1] 1
#> 
#> $se_null
#> [1] 1.118034
#> 
#> $n
#> [1] 5
#> 
#> $method
#> [1] "Rao score test for a binomial proportion"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"