pystatpower.mean.single.ci
¶
| FUNCTION | DESCRIPTION |
|---|---|
solve_precision |
Calculate the distance from the mean to the confidence limit (commonly known as precision). |
solve_size |
Estimate the required sample size. |
solve_std |
Estimate the required standard deviation. |
solve_precision
¶
solve_precision(
*,
std: float,
size: int,
conf_level: float = 0.95,
interval_type: Literal["two-sided", "one-sided", "lower", "upper"] = "two-sided",
dist: Literal["z", "t"] = "t",
) -> float
Calculate the distance from the mean to the confidence limit (commonly known as precision).
| PARAMETER | DESCRIPTION |
|---|---|
std
|
Standard deviation.
TYPE:
|
size
|
Sample size.
TYPE:
|
conf_level
|
Confidence level.
TYPE:
|
interval_type
|
The type of confidence interval.
TYPE:
|
dist
|
The distribution used to construct the confidence interval.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The distance from the mean to the confidence limit (commonly known as precision). |
Notes
Since the confidence interval for the mean is symmetric, specifying interval_type as 'lower', 'upper', or 'one-sided' works consistently.
solve_size
¶
solve_size(
*,
precision: float,
std: float,
conf_level: float = 0.95,
interval_type: Literal["two-sided", "one-sided", "lower", "upper"] = "two-sided",
dist: Literal["z", "t"] = "t",
) -> int
Estimate the required sample size.
| PARAMETER | DESCRIPTION |
|---|---|
precision
|
Distance from the mean to the confidence limit.
TYPE:
|
std
|
Standard deviation.
TYPE:
|
conf_level
|
Confidence level.
TYPE:
|
interval_type
|
The type of confidence interval.
TYPE:
|
dist
|
The distribution used to construct the confidence interval.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
The required sample size. |
Notes
Since the confidence interval for the mean is symmetric, specifying interval_type as 'lower', 'upper', or 'one-sided' works consistently.
solve_std
¶
solve_std(
*,
precision: float,
size: int,
conf_level: float = 0.95,
interval_type: Literal["two-sided", "one-sided", "lower", "upper"] = "two-sided",
dist: Literal["z", "t"] = "t",
) -> float
Estimate the required standard deviation.
| PARAMETER | DESCRIPTION |
|---|---|
precision
|
Distance from the mean to the confidence limit.
TYPE:
|
size
|
Sample size.
TYPE:
|
conf_level
|
Confidence level.
TYPE:
|
interval_type
|
The type of confidence interval.
TYPE:
|
dist
|
The distribution used to construct the confidence interval.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The required standard deviation. |
Notes
Since the confidence interval for the mean is symmetric, specifying interval_type as 'lower', 'upper', or 'one-sided' works consistently.