650 likes | 778 Views
Statistics & Data Analysis. Course Number B01.1305 Course Section 31 Meeting Time Wednesday 6-8:50 pm. CLASS #6. Class #6 Outline. Point estimation Confidence interval estimation Determining sample sizes Introduction to Regression and Correlation Analysis. Review of Last Class.
E N D
Statistics & Data Analysis Course Number B01.1305 Course Section 31 Meeting Time Wednesday 6-8:50 pm CLASS #6
Class #6 Outline • Point estimation • Confidence interval estimation • Determining sample sizes • Introduction to Regression and Correlation Analysis
Review of Last Class • Sampling distributions for sample statistics
Point and Interval Estimation Chapter 8
Review • Basic problem of statistical theory is how to infer a population or process value given only sample data • Any sample statistic will vary from sample to sample • Any sample statistic will differ from the true, population value • Must consider random error in sample statistic estimation
Chapter Goals • Summarize sample data • Choosing an estimator • Unbiased estimator • Constructing confidence intervals for means with known standard deviation • Constructing confidence intervals for proportions • Determining how large a sample is needed • Constructing confidence intervals when standard deviation is not known • Understanding key underlying assumptions underlying confidence interval methods
Reminder: Statistical Inference • Problem of Inferential Statistics: • Make inferences about one or more population parameters based on observable sample data • Forms of Inference: • Point estimation: single best guess regarding a population parameter • Interval estimation: Specifies a reasonable range for the value of the parameter • Hypothesis testing: Isolating a particular possible value for the parameter and testing if this value is plausible given the available data
Point Estimators • Computing a single statistic from the sample data to estimate a population parameter • Choosing a point estimator: • What is the shape of the distribution? • Do you suspect outliers exist? • Plausible choices: • Mean • Median • Mode • Trimmed Mean
Example • I used R to draw 1,000 samples, each of size 30, from a normally distributed population having mean 50 and standard deviation 10. data.mean = data.median = numeric(0) for(i in 1:1000) { data = rnorm(n=30, mean=50, sd=10) data.mean[i] = mean(data) data.median[i] = median(data) } • For each sample the mean and median are computed. • Do these statistics appear unbiased? • Which is more efficient?
Example • I used R to draw 1,000 samples, each of size 30, from an extremely skewed population with mean and standard deviation both equal to 2. data.mean = data.median = numeric(0) for(i in 1:1000) { data = rt(n=30, 3) data.mean[i] = mean(data) data.median[i] = median(data) } • For each sample the mean and median are computed. • Do these statistics appear unbiased? • Which is more efficient?
Confidence Interval • An interval with random endpoints which contains the parameter of interest (in this case, μ) with a pre-specified probability, denoted by 1 - α. • The confidence interval automatically provides a margin of error to account for the sampling variability of the sample statistic. • Example: A machine is supposed to fill “12 ounce” bottles of Guinness. To see if the machine is working properly, we randomly select 100 bottles recently filled by the machine, and find that the average amount of Guinness is 11.95 ounces. Can we conclude that the machine is not working properly?
No! By simply reporting the sample mean, we are neglecting the fact that the amount of beer varies from bottle to bottle and that the value of the sample mean depends on the luck of the draw • It is possible that a value as low as 11.75 is within the range of natural variability for the sample mean, even if the average amount for all bottles is in fact μ = 12 ounces. • Suppose we know from past experience that the amounts of beer in bottles filled by the machine have a standard deviation of σ = 0.05 ounces. • Since n = 100, we can assume (using the Central Limit Theorem) that the sample mean is normally distributed with mean μ (unknown) and standard error 0.005 • What does the Empirical Rule tell us about the average volume of the sample mean?
Confidence Intervals • “Statistics is never having to say you're certain”. • (Tee shirt, American Statistical Association). • Any sample statistic will vary from sample to sample • Point estimates are almost inevitably in error to some degree • Thus, we need to specify a probable range or interval estimate for the parameter
Example • An airline needs an estimate of the average number of passengers on a newly scheduled flight • Its experience is that data for the first month of flights are unreliable, but thereafter the passenger load settles down • The mean passenger load is calculated for the first 20 weekdays of the second month after initiation of this particular flight • If the sample mean is 112 and the population standard deviation is assumed to be 25, find a 95% confidence interval for the true, long-run average number of passengers on this flight • Find the 90% confidence interval for the mean
Interpretation • The significance level of the confidence interval refers to the process of constructing confidence intervals • Each particular confidence interval either does or does not include the true value of the parameter being estimated • We can’t say that this particular estimate is correct to within the error • So, we say that we have a XX% confidence that the population parameter is contained in the interval • Or…the interval is the result of a process that in the long run has a XX% probability of being correct
Imagine Many Samples Other intervals you might have computed Missed! Missed! The interval you computed 22 23 24 The population mean = 23.29
Example • A signal transmitting value m is sent from California, the value received in NY is normally distributed with mean m and variance 4. • To reduce error, the same value is sent 9 times • If the successive values received are: • 5, 8.5, 12, 15, 7, 9, 7.5, 6.5, 10.5 • Construct a 99% confidence interval for m
Getting Realistic • The population standard deviation is rarely known • Usually both the mean and standard deviation must be estimated from the sample • Estimate with s • However…with this added source of random errors, we need to handle this problem using the t-distribution (later on)
Confidence Intervals for Proportions • We can also construct confidence intervals for proportions of successes • Recall that the expected value and standard error for the number of successes in a sample are: • How can we construct a confidence interval for a proportion?
Example • Suppose that in a sample of 2,200 households with one or more television sets, 471 watch a particular network’s show at a given time. • Find a 95% confidence interval for the population proportion of households watching this show.
Example • The 1992 presidential election looked like a very close three-way race at the time when news polls reported that of 1,105 registered voters surveyed: • Perot: 33% • Bush: 31% • Clinton: 28% • Construct a 95% confidence interval for Perot? • What is the margin of error? • What happened here?
Example • A survey conducted found that out of 800 people, 46% thought that Clinton’s first approved budget represented a major change in the direction of the country. • Another 45% thought it did not represent a major change. • Compute a 95% confidence interval for the percent of people who had a positive response. • What is the margin of error? • Interpret…
Choosing a Sample Size • Gathering information for a statistical study can be expensive, time consuming, etc. • So…the question of how much information to gather is very important • When considering a confidence interval for a population mean , there are three quantities to consider:
Choosing a Sample Size (cont) • Tolerability Width: The margin of acceptable error • ±3% • ± $10,000 • Derive the required sample size using: • Margin of error (tolerability width) • Level of Significance (z-value) • Standard deviation (given, assumed, or calculated)
Example • Union officials are concerned about reports of inferior wages being paid to employees of a company under its jurisdiction • How large a sample is needs to obtain a 90% confidence interval for the population mean hourly wage with width equal to $1.00? Assume that =4.
Example • A direct-mail company must determine its credit policies very carefully. • The firm suspects that advertisements in a certain magazine have led to an excessively high rate of write-offs. • The firm wants to establish a 90% confidence interval for this magazine’s write-off proportion that is accurate to ± 2.0% • How many accounts must be sampled to guarantee this goal? • If this many accounts are sampled and 10% of the sampled accounts are determined to be write-offs, what is the resulting 90% confidence interval? • What kind of difference do we see by using an observed proportion over a conservative guess?
The t Distribution • Up until now, we have assumed that the population standard deviation is known or that we choose a large enough sample so the sample standard deviation s can replace . • Sometimes a large sample is not possible • So far, we’ve based the confidence interval on the z statistic:
The t Distribution (cont) • When the population standard deviation is unknown, it must be replaced by the sample statistic • This yields the summary statistic • This statistic follows a t-Distribution
The t Distribution (cont) • This statistic was derived by W. S. Gosset • Gosset obtained a post as a chemist in the Guinness brewery in Dublin in 1899 and did important work on statistics • He invented the t Distribution to handle small samples for quality control in brewing • He wrote under the name "Student"
Properties of the t Distribution • Symmetric about the mean 0 • More variable than the z-distribution
Properties of the t Distribution (cont) • There are many different t distributions. • We specify a particular one by its degrees of freedom • If a random sample is taken from a normal population, then the statistic:has a t distribution with d.f. = n-1 • As sample size increases, the t-distribution approaches the z-distribution • R functions
Degrees of Freedom • Technical definition fairly complex • Intuitively: d.f. refers to the estimated standard deviation and is used to indicate the number of pieces of information available for that estimate • The standard deviation is based on n deviations from the mean, but the deviations must sum to 0, so only n-1 deviations are free to vary
Example • How long should you wait before ordering new inventory? • If you choose too soon, you pay stocking costs • If you choose too late, you risk stock-outs • Your supplier says goods will arrive in two weeks (10 business days), but you made note of how many business days it actually took: 10, 9, 7, 10, 3, 9, 12, 5 • Calculate the sample mean, standard deviation, and standard error for this sample • What is the probability a shipment takes more than two weeks?
Example • How long should you wait before ordering new inventory? • If you choose too soon, you pay stocking costs • If you choose too late, you risk stock-outs • Your supplier says goods will arrive in two weeks (10 business days), but you made note of how many business days it actually took: 10, 9, 7, 10, 3, 9, 12, 5 • Calculate a 95% confidence interval for the mean delivery time
Assumptions • Assumptions needed for validity of the Confidence Interval 1. Data are a RANDOM SAMPLE from the population of interest • (So that the sample can tell you about the population) 2. The sample average is approximately NORMAL • Either the data are normal (check the histogram) • Or the central limit theorem applies: • Large enough sample size n, distribution not too skewed • (So that the t table is technically appropriate)
Linear Regression and Correlation Methods Chapter 11
Chapter Goals • Introduction to Bivariate Data Analysis • Introduction to Simple Linear Regression Analysis • Introduction to Linear Correlation Analysis • Interpret scatter plots
Motivating Example • Before a pharmaceutical sales rep can speak about a product to physicians, he must pass a written exam • An HR Rep designed such a test with the hopes of hiring the best possible reps to promote a drug in a high potential area • In order to check the validity of the test as a predictor of weekly sales, he chose 5 experienced sales reps and piloted the test with each one • The test scores and weekly sales are given in the following table:
Introduction to Bivariate Data • Up until now, we’ve focused on univariate data • Analyzing how two (or more) variables “relate” is very important to managers • Prediction equations • Estimate uncertainty around a prediction • Identify unusual points • Describe relationship between variables • Visualization • Scatterplot
Scatterplot Do Test Score and Weekly Sales appear related?
Correlation Boomers' Little Secret Still Smokes Up the Closet July 14, 2002 …Parental cigarette smoking, past or current, appeared to have a stronger correlation to children's drug use than parental marijuana smoking, Dr. Kandel said. The researchers concluded that parents influence their children not according to a simple dichotomy — by smoking or not smoking — but by a range of attitudes and behaviors, perhaps including their style of discipline and level of parental involvement. Their own drug use was just one component among many… A Bit of a Hedge to Balance the Market Seesaw July 7, 2002 …Some so-called market-neutral funds have had as many years of negative returns as positive ones. And some have a high correlation with the market's returns…
Correlation Analysis • Statistical techniques used to measure the strength of the relationship between two variables • Correlation Coefficient: describes the strength of the relationship between two sets of variables • Denoted r • r assumes a value between –1 and +1 • r = -1 or r = +1 indicates a perfect correlation • r = 0 indicates not relationship between the two sets of variables • Direction of the relationship is given by the coefficient’s sign • Strength of relationship does not depend on the direction • r means LINEAR relationship ONLY