230 likes | 236 Views
MET 136 Statistical Climatology - Lecture 11. Confidence Intervals Dr. Marty Leach San Jose State University Reading: Gonick Chapter 7. Sampling. We previously studied how samples of large populations were distributed.
E N D
MET 136 Statistical Climatology - Lecture 11 Confidence Intervals Dr. Marty Leach San Jose State University Reading: Gonick Chapter 7
Sampling • We previously studied how samples of large populations were distributed. • Now, we’ll look at one sample, and study what we can determine from this alone.
Confidence Intervals • Are used extensively in science • Used in election polls (watch it!) • Example: • The average global air temperature near the Earth's surface increased 0.74 0.18ºC (1.33 0.32 º F) during the 100 years ending in 2005. (IPCC 2007)
Example 1 • Election Numbers • http://www.surveyusa.com/client/PollPrint.aspx?g=252060cf-f1d3-49bc-80ed-24d0c9122b49&d=0 • Let’s look at the numbers
Poll • Surveyed 661 likely to vote people • N=661 • Randomly selected • Result:
Standard deviation of normal • To determine the accuracy of this probability, we need to calculate the standard deviation: • Only problem…we don’t know true probability, p.
Standard Error • Only thing we can do is use the standard error (which uses the sampled probability (p-hat) • This is called the standard error
Standard Error • So now we can estimate the confidence interval at the 95% level • This says that 95% of the time, the true probability p will fall within these two values.
Calculate confidence interval • Let’s calculate the 95% confidence interval for the presidental poll in CA. • N=661 • So that now, p is within the range: • 0.53±1.96*0.019 • p=0.53 ± 0.038
Interpretation • So what does this mean? • p=0.53 ± 0.038 • 0.492 ≤ p ≤ 0.568 • Slight oversight… • Obama: 53 McCain: 43 Undecided/other: 4
20 samples with n=1000; assume true value p=0.5. Shown are 95% confidence interval. On average 1 in 20 will not cover 0.5
Improve the results • Suppose we want more confidence, say 99%, what can we do? • Widen the confidence interval • Increase the sample size
Example • Redo the confidence interval at the 99% level • Result: • 0.53±2.58*0.019 • p=0.53 ± 0.049 • 0.481 ≤ p ≤ 0.579 • But now our margin of error is larger… (e.g. I’m 100% confident the probability will be between 0 and 1!
Sample Size • But what if we are not happy that our error has gone up. The other way to keep the error down and the confidence high is to increase the sample size. • Where Z is from the normal table (pg 84), p* is the estimate of the probability and E is the margin of error.
Example • So now calculate the sample size required to produce a margin of error of 0.01 and a 99% confidence level. • Result • More then 16,000 respondents! • Limits to polling…
Confidence intervals for the mean • Now, we’ll look at confidence intervals for the mean, not the probability.
Standard Error • The standard error of the mean is defined as: • Where s is the sample standard deviation
Example • Suppose that you calculate the average winter low temperature in Silicon Valley during the last 25 years to be 41.5F and the standard deviation is 3.2F. • Compute the 95% confidence interval for the mean temperature. • If temperatures below 40F are required for fruit to start growing in the valley, would you expect this to happen in a typical winter?
Student’s t • We’ve discussed that as the sample size increases, the distribution approaches a normal distribution. • We can quantify this using the degrees of freedom. • If you have x1, x2, …xn data points, then you have n-1 degrees of freedom. • So, we can choose a t-distribution for n-1 degrees of freedom.
Mean using a t-distribution • So, using a t-distribution, the mean and the confidence interval is given by: