pystatpower.models.mean.single.inequality
¶
Functions:
| Name | Description |
|---|---|
solve_power |
Calculate the statistical power for an inequality test of one mean. |
solve_size |
Estimate the sample size required for an inequality test of one mean. |
solve_null_mean |
Estimate the mean under the null hypothesis required for an inequality test of one mean. |
solve_mean |
Estimate the mean under the alternative hypothesis required for an inequality test of one mean. |
solve_power
¶
solve_power(*, null_mean: float, mean: float, std: float, size: int, alternative: Literal['lower', 'upper', 'both'], alpha: float, method: Literal['z', 't']) -> float
Calculate the statistical power for an inequality test of one mean.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
null_mean
|
float
|
Mean under the null hypothesis (\(\mu_0\)). |
required |
mean
|
float
|
Mean under the alternative hypothesis (\(\mu_1\)). |
required |
std
|
float
|
Standard deviation (\(\sigma\)). If |
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['lower', 'upper', 'both']
|
The direction of the alternative hypothesis.
|
required |
alpha
|
float
|
Significance level. |
required |
method
|
Literal['z', 't']
|
The distribution used for the test.
|
required |
Returns:
| Type | Description |
|---|---|
float
|
The calculated statistical power of the test. |
solve_size
¶
solve_size(*, null_mean: float, mean: float, std: float, alternative: Literal['lower', 'upper', 'both'], alpha: float, power: float, method: Literal['z', 't']) -> int
Estimate the sample size required for an inequality test of one mean.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
null_mean
|
float
|
Mean under the null hypothesis (\(\mu_0\)). |
required |
mean
|
float
|
Mean under the alternative hypothesis (\(\mu_1\)). |
required |
std
|
float
|
Standard deviation (\(\sigma\)). If |
required |
alternative
|
Literal['lower', 'upper', 'both']
|
The direction of the alternative hypothesis.
|
required |
alpha
|
float
|
Significance level. |
required |
power
|
float
|
Desired statistical power. |
required |
method
|
Literal['z', 't']
|
The distribution used for the test.
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The required sample size. |
solve_null_mean
¶
solve_null_mean(*, mean: float, std: float, size: int, alternative: Literal['lower', 'upper', 'both'], alpha: float, power: float, method: Literal['z', 't'], search_direction: Literal['below', 'above'] = 'below') -> float
Estimate the mean under the null hypothesis required for an inequality test of one mean.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean
|
float
|
Mean under the alternative hypothesis (\(\mu_1\)). |
required |
std
|
float
|
Standard deviation (\(\sigma\)). If |
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['lower', 'upper', 'both']
|
The direction of the alternative hypothesis.
|
required |
alpha
|
float
|
Significance level. |
required |
power
|
float
|
Desired statistical power. |
required |
method
|
Literal['z', 't']
|
The distribution used for the test.
|
required |
search_direction
|
Literal['below', 'above']
|
Specify whether to search for the null mean below or above the alternative mean.
|
'below'
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The required mean under the null hypothesis. |
solve_mean
¶
solve_mean(*, null_mean: float, std: float, size: int, alternative: Literal['lower', 'upper', 'both'], alpha: float, power: float, method: Literal['z', 't'], search_direction: Literal['below', 'above'] = 'above') -> float
Estimate the mean under the alternative hypothesis required for an inequality test of one mean.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
null_mean
|
float
|
Mean under the null hypothesis (\(\mu_0\)). |
required |
std
|
float
|
Standard deviation (\(\sigma\)). If |
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['lower', 'upper', 'both']
|
The direction of the alternative hypothesis.
|
required |
alpha
|
float
|
Significance level. |
required |
power
|
float
|
Desired statistical power. |
required |
method
|
Literal['z', 't']
|
The distribution used for the test.
|
required |
search_direction
|
Literal['below', 'above']
|
Specify whether to search for the alternative mean below or above the null mean.
|
'above'
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The required mean under the alternative hypothesis. |