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 required sample size for an inequality test of one mean. |
solve_null_mean |
Estimate the required mean under the null hypothesis for an inequality test of one mean. |
solve_mean |
Estimate the required mean under the alternative hypothesis for an inequality test of one mean. |
solve_power
¶
solve_power(
*,
null_mean: float,
mean: float,
std: float,
size: int,
alternative: Literal[
"two-sided", "lower one-sided", "upper one-sided"
],
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\)).
|
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['two-sided', 'lower one-sided', 'upper one-sided']
|
Type 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[
"two-sided", "lower one-sided", "upper one-sided"
],
alpha: float,
power: float,
method: Literal["z", "t"],
) -> int
Estimate the required sample size 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\)).
|
required |
alternative
|
Literal['two-sided', 'lower one-sided', 'upper one-sided']
|
Type 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:
| Type | Description |
|---|---|
int
|
The required sample size. |
solve_null_mean
¶
solve_null_mean(
*,
mean: float,
std: float,
size: int,
alternative: Literal[
"two-sided", "lower one-sided", "upper one-sided"
],
alpha: float,
power: float,
method: Literal["z", "t"],
search_direction: Literal["below", "above"] = "below",
) -> float
Estimate the required mean under the null hypothesis 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\)).
|
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['two-sided', 'lower one-sided', 'upper one-sided']
|
Type 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:
| Type | Description |
|---|---|
float
|
The required mean under the null hypothesis. |
solve_mean
¶
solve_mean(
*,
null_mean: float,
std: float,
size: int,
alternative: Literal[
"two-sided", "lower one-sided", "upper one-sided"
],
alpha: float,
power: float,
method: Literal["z", "t"],
search_direction: Literal["below", "above"] = "above",
) -> float
Estimate the required mean under the alternative hypothesis 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\)).
|
required |
size
|
int
|
Sample size (\(n\)). |
required |
alternative
|
Literal['two-sided', 'lower one-sided', 'upper one-sided']
|
Type 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:
| Type | Description |
|---|---|
float
|
The required mean under the alternative hypothesis. |