Functions > Statistics > Descriptive Statistics > Example: Confidence Interval for the Mean
  
Example: Confidence Interval for the Mean
Calculate a confidence interval for an estimate of the mean of a normal population when the population variance is unknown.
1. Define a sample data set.
Click to copy this expression
2. Use functions length, mean and stdev to collect the sample statistics.
Number of samples
Click to copy this expression
Click to copy this expression
Sample mean
Click to copy this expression
Click to copy this expression
Sample standard deviation
Click to copy this expression
Click to copy this expression
Degrees of freedom
Click to copy this expression
Click to copy this expression
3. Enter the two-tailed significance level:
Click to copy this expression
This is equivalent to a 95% confidence interval.
4. Use function qt to calculate the 95th percentile of the Student t-distribution for a two-tailed test.
Click to copy this expression
Click to copy this expression
5. Calculate the lower and upper limits of the confidence interval.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
6. Plot the sample data, its mean and confidence interval.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
7. Use function pt to calculate the cumulative probability distribution for the confidence interval:
Click to copy this expression
8. Use function rt to create a vector of random numbers having a Student's t-distribution:
Click to copy this expression
Recalculating the worksheet causes function rt to return a different set of random numbers.