跳转至

pystatpower.misc.observe_at_least_one_event

FUNCTION DESCRIPTION
solve_power

Calculate the detection power.

solve_size

Estimate the required sample size.

solve_proportion

Estimate the required event proportion.

solve_power

solve_power(*, proportion: float, size: int, dist: Literal['bin', 'poisson'] = 'bin') -> float

Calculate the detection power.

PARAMETER DESCRIPTION
proportion

Event proportion.

TYPE: float

size

Sample size.

TYPE: int

dist

The distribution of the number of events that occurred.

  • 'bin': binomial distribution
  • 'poisson': Poisson distribution

TYPE: Literal['bin', 'poisson'] DEFAULT: 'bin'

RETURNS DESCRIPTION
float

The power to observe at least one event.

solve_size

solve_size(*, proportion: float, power: float = 0.95, dist: Literal['bin', 'poisson'] = 'bin') -> int

Estimate the required sample size.

PARAMETER DESCRIPTION
proportion

Event proportion.

TYPE: float

power

The detection power.

0.95 is a commonly used value for the detection power.

TYPE: float DEFAULT: 0.95

dist

The distribution of the number of events that occurred.

  • 'bin': binomial distribution
  • 'poisson': Poisson distribution

TYPE: Literal['bin', 'poisson'] DEFAULT: 'bin'

RETURNS DESCRIPTION
int

The required sample size.

solve_proportion

solve_proportion(*, size: int, power: float = 0.95, dist: Literal['bin', 'poisson'] = 'bin') -> float

Estimate the required event proportion.

PARAMETER DESCRIPTION
size

Sample size.

TYPE: int

power

The detection power.

0.95 is a commonly used value for the detection power.

TYPE: float DEFAULT: 0.95

dist

The distribution of the number of events that occurred.

  • 'bin': binomial distribution
  • 'poisson': Poisson distribution

TYPE: Literal['bin', 'poisson'] DEFAULT: 'bin'

RETURNS DESCRIPTION
float

The required event proportion.