In previous page, we examined the effect of confidence level on confidence interval. Another factor that effect on this interval is distribution of estimated parameter. In this page we discuss the confidence interval for mean, proportion and variance (or standard deviation) under the effect of these factors.
Confidence interval for mean
Student's distribution
Consider a population with mean `mu` and standard deviation `sigma`. Taken a sample with size `n`, the mean and standard deviation of this sample are `bar x` and `s` respectively. Because sampling is random, so these values are random variables. In the discussion about distribution of statistics, we know that the variable
| `t=((bar x-mu)sqrt(n))/s` | (10) |
conforms to Student's distribution.
Estimation for mean
After obtaining mean `bar x` and standard deviation `s` of sample with size `n`, confidence interval of `mu` with confidence level `1–alpha` is determined by:
| `bar x-t_(alpha//2,\ nu)s/sqrt(n)<=mu<=bar x+t_(alpha//2,\ nu)s/sqrt(n)` | (11) |
in which `nu=n–1` is degree of freedom, value of `t_(alpha//2,\ nu)` can be found in percentage point table of Student's distribution.
Example
In determining fuel consumption of 20 motorcycles of company C, we obtain that the average distance travelled per litre of petrol A92 is 54,2 km with standard deviation of 6,3 km. Estimate the confidence interval of the average distance travelled per litre of petrol A92 of motorcycles of company C with confidence level of 95%.
We have : `alpha=0,05` ; `alpha//2=0,025` ; `nu=n-1=20-1=19`
From percentage point table of Student's distribution : `t_(0,025,\ 19)=2,093`
`t_(0,025,19)xx(6,3)/sqrt(20)=2,948`
With confidence interval of 95%, the mean confidence interval of distance travelled per each litre of petrol A92 is ((54,2-2,9) - (54,2+2,9)) km or (51,3 - 57,1) km.
Special cases
- If the sample is large, we can use `z_(alpha//2)` instead of `t_(alpha//2,df)`.
- If `sigma` is known, we use `sigma` instead of `s`.
Confidence interval for proportion
Distribution of proportion
Consider a population which the proportion of elements belonging to group A is `pi`. Take randomly samples of size `n` (`n>=30`) from this population. The proportion of elements belong to group A in samples are `p`. `p` is a random variable. If the number of samples is large, `p` conforms to normal distribution with mean `pi`.
Estimation for proportion
With confidence level `1–alpha`, confidence interval for the proportion of elements belonging to group A in population is determined by:
| `(p-z_(alpha//2)sqrt((p(1-p))/n),\ \ p+z_(alpha//2)sqrt((p(1-p))/n) )` | (12) |
in which `p` is the proportion of elements belonging to group A of sample, `n` is the number of elements of sample (`n>=30`).
Note that the confidence interval for proportion can not contain 0 or 1.
Example
In a survey about energy consumption in district D, a sample of 150 houses is taken to investigate. In this sample, there are 48 houses using air conditioner. With confidence level of 95%, estimate the proportion of house in district D using air conditioner.
The proportion of house in sample using air conditioner is `p=48//150=0,32`
And `alpha=0,05` ; `alpha//2=0,025` ;
Using percentage point table of Student's distribution: `z_(0,025)=1,96` (the last row of table).
Hence
`z_(alpha//2)sqrt((p(1-p))/n)=1,96sqrt((0,32xx0,68)/150)=0,0747`
So `pi` belongs to interval ((`0,3200-0,0747`) to (`0,3200+0,0747`)).
Therefore, with confidence level 95%, proportion of house using air conditioner in district D is estimated in interval 24,53% to 39,47%
Confidence interval for variance
The procedure to estimate variance is similar to that of mean and proportion. Because the variance of samples has chi-square distribution, so the confidence interval of variance corresponds to confidence level `1-alpha` is determined by:
| `((n-1)s^2)/(chi_(alpha//2,\ n-1)^2)<=sigma^2<=((n-1)s^2)/(chi_(1-alpha//2,\ n-1)^2)` | (13) |
in which `nu=n-1` is the degree of freedom, `chi_(1-alpha//2,\ n-1)^2` and `chi_(alpha//2,\ n-1)^2` are determined by percentage point table of chi-square distribution.