pystatpower.correlation.inequality
¶
| FUNCTION | DESCRIPTION |
|---|---|
solve_power |
Calculate the statistical power. |
solve_size |
Estimate the required sample size. |
solve_correlation |
Estimate the required correlation coefficient under the alternative hypothesis. |
solve_null_correlation |
Estimate the required correlation coefficient under the null hypothesis. |
solve_power
¶
solve_power(
*,
null_correlation: float,
correlation: float,
size: int,
alternative: Literal["two-sided", "greater", "less"] = "two-sided",
alpha: float = 0.05,
) -> float
Calculate the statistical power.
| PARAMETER | DESCRIPTION |
|---|---|
null_correlation
|
Correlation coefficient under the null hypothesis.
TYPE:
|
correlation
|
Correlation coefficient under the alternative hypothesis.
TYPE:
|
size
|
Sample size.
TYPE:
|
alternative
|
Type of the alternative hypothesis.
TYPE:
|
alpha
|
Significance level.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The statistical power of the test. |
solve_size
¶
solve_size(
*,
null_correlation: float,
correlation: float,
alternative: Literal["two-sided", "greater", "less"] = "two-sided",
alpha: float = 0.05,
power: float = 0.8,
) -> int
Estimate the required sample size.
| PARAMETER | DESCRIPTION |
|---|---|
null_correlation
|
Correlation coefficient under the null hypothesis.
TYPE:
|
correlation
|
Correlation coefficient under the alternative hypothesis.
TYPE:
|
alternative
|
Type of the alternative hypothesis.
TYPE:
|
alpha
|
Significance level.
TYPE:
|
power
|
Expected statistical power. 0.8 is a commonly used value for statistical power.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
The required sample size. |
solve_correlation
¶
solve_correlation(
*,
null_correlation: float,
size: int,
alternative: Literal["two-sided", "greater", "less"] = "two-sided",
alpha: float = 0.05,
power: float = 0.8,
direction: Literal["greater", "less"] | None = None,
) -> float
Estimate the required correlation coefficient under the alternative hypothesis.
| PARAMETER | DESCRIPTION |
|---|---|
null_correlation
|
Correlation coefficient under the null hypothesis.
TYPE:
|
size
|
Sample size.
TYPE:
|
alternative
|
Type of the alternative hypothesis.
TYPE:
|
alpha
|
Significance level.
TYPE:
|
power
|
Expected statistical power. 0.8 is a commonly used value for statistical power.
TYPE:
|
direction
|
The direction for the correlation coefficient under the alternative hypothesis relative to the correlation coefficient under the null hypothesis.
Note
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The required correlation coefficient under the alternative hypothesis. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
solve_null_correlation
¶
solve_null_correlation(
*,
correlation: float,
size: int,
alternative: Literal["two-sided", "greater", "less"] = "two-sided",
alpha: float = 0.05,
power: float = 0.8,
direction: Literal["greater", "less"] | None = None,
) -> float
Estimate the required correlation coefficient under the null hypothesis.
| PARAMETER | DESCRIPTION |
|---|---|
correlation
|
Correlation coefficient under the alternative hypothesis.
TYPE:
|
size
|
Sample size.
TYPE:
|
alternative
|
Type of the alternative hypothesis.
TYPE:
|
alpha
|
Significance level.
TYPE:
|
power
|
Expected statistical power. 0.8 is a commonly used value for statistical power.
TYPE:
|
direction
|
The direction for the correlation coefficient under the null hypothesis relative to the correlation coefficient under the alternative hypothesis.
Note
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The required correlation coefficient under the null hypothesis. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |