Learn R Programming

MSPRT (version 2.1)

LR.oneProp: Likelihood ratio in one-sample proportion tests

Description

Given a simple null and a simple alternative hypotheses, this function calculates the likelihood ratio (LR) in favor of the alternative based on an observed data in one-sample proportion tests.

Usage

LR.oneProp(m, suff.stat, null = 0.5, alt)

Arguments

m

a postive numeric (integer); number of samples for computing the LR.

suff.stat

a postive numeric (integer); the value of sufficient statistic based on m observed data.

In this case, the sufficient statistic is the total no. of successes out of m observations.

null

a numeric in (0,1); the hypothesized value of proportion under the simple null.

Default: 0.5.

alt

a numeric in (0,1); the hypothesized value of proportion under the simple alternative.

Value

Returns a numeric denoting the LR in favor of alt in the one-sample proportion test based on m observations.

References

MSPRT: supplemental information

Examples

Run this code
# NOT RUN {
LR.oneProp(m= 60, suff.stat= 48, null= 0.2, alt= 0.5)
# }

Run the code above in your browser using DataLab