跳转至

pystatpower.models.correlation.inequality

Functions:

Name Description
solve_power

Calculate the power of the difference test between two correlation coefficients.

solve_size

Estimate the sample size required for the difference test between two correlation coefficients.

solve_correlation

Estimate the alternative correlation coefficient required for the difference test between two correlation coefficients.

solve_null_correlation

Estimeta the null correlation coefficient required for the difference test between two correlation coefficients.

solve_power

solve_power(*, null_correlation: float, correlation: float, size: float, alpha: float = 0.05, bias_adj: bool = False) -> float

Calculate the power of the difference test between two correlation coefficients.

Parameters:

Name Type Description Default
null_correlation float

Correlation coefficient under the null hypothesis.

required
correlation float

Correlation coefficient under the alternative hypothesis.

required
size float

Sample size.

required
alpha float

Significance level. Default is 0.05.

0.05
bias_adj bool

Specify whether or not the bias adjustment is used. Default is False.

False

Returns:

Name Type Description
power float

Power of the test.

solve_size

solve_size(*, null_correlation: float, correlation: float, alpha: float = 0.05, power: float = 0.8, bias_adj: bool = False) -> float

Estimate the sample size required for the difference test between two correlation coefficients.

Parameters:

Name Type Description Default
null_correlation float

Correlation coefficient under the null hypothesis.

required
correlation float

Correlation coefficient under the alternative hypothesis.

required
alpha float

Significance level. Default is 0.05.

0.05
power float

Power of the test. Default is 0.80.

0.8
bias_adj bool

Specify whether or not the bias adjustment is used. Default is False.

False

Returns:

Name Type Description
size float

The required sample size.

solve_correlation

solve_correlation(*, null_correlation: float, size: float, alpha: float = 0.05, power: float = 0.8, bias_adj: bool = False, search_direction: str = 'upper') -> float

Estimate the alternative correlation coefficient required for the difference test between two correlation coefficients.

Parameters:

Name Type Description Default
null_correlation float

Correlation coefficient under the null hypothesis.

required
size float

Sample size.

required
alpha float

Significance level. Default is 0.05.

0.05
power float

Power of the test. Default is 0.80.

0.8
bias_adj bool

Specify whether or not the bias adjustment is used. Default is False.

False
search_direction str

Specify the search direction relative to the null correlation. Default is 'upper'.

'upper'

Returns:

Name Type Description
correlation float

The required alternative correlation.

solve_null_correlation

solve_null_correlation(*, correlation: float, size: int, alpha: float = 0.05, power: float = 0.05, bias_adj: bool = False, search_direction: str = 'lower') -> float

Estimeta the null correlation coefficient required for the difference test between two correlation coefficients.

Parameters:

Name Type Description Default
correlation float

Correlation coefficient under the alternative hypothesis.

required
size int

Sample size.

required
alpha float

Significance level. Default is 0.05.

0.05
power float

Power of the test. Default is 0.05.

0.05
bias_adj bool

Specify whether or not the bias adjustment is used. Default is False.

False
search_direction str

Specify the search direction relative to the alternative correlation. Default is 'lower'.

'lower'

Returns:

Name Type Description
null_correlation float

The required null correlation.