confidence_interval
Compute the confidence interval for a dataset's mean to estimate the range likely containing the true population mean. Enter numerical values and an optional confidence level.
Instructions
Computes the confidence interval for the mean of a dataset.
Args: data: A list of numerical values. confidence: The confidence level (default is 0.95).
Returns: On success: {"confidence_interval": <(lower_bound, upper_bound)>} On error: {"error": }
Examples: >>> import numpy as np >>> np.random.seed(42) # For reproducible results >>> confidence_interval([1, 2, 3, 4]) # doctest: +ELLIPSIS {'confidence_interval': (0.445739743239..., 4.554260256760...)}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| confidence | No |