Last few slides from last time

Similar documents
Lecture 8 Sampling Theory

Central Limit Theorem and the Law of Large Numbers Class 6, Jeremy Orloff and Jonathan Bloom

CSE 103 Homework 8: Solutions November 30, var(x) = np(1 p) = P r( X ) 0.95 P r( X ) 0.

Mean/Average Median Mode Range

Sequential Logic (3.1 and is a long difficult section you really should read!)

Basic Probability. Introduction

CS 361: Probability & Statistics

Confidence intervals CE 311S

The Central Limit Theorem

Sampling Distribution Models. Chapter 17

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 20

*Karle Laska s Sections: There is no class tomorrow and Friday! Have a good weekend! Scores will be posted in Compass early Friday morning

MA 1125 Lecture 15 - The Standard Normal Distribution. Friday, October 6, Objectives: Introduce the standard normal distribution and table.

where Female = 0 for males, = 1 for females Age is measured in years (22, 23, ) GPA is measured in units on a four-point scale (0, 1.22, 3.45, etc.

Experiment 2 Random Error and Basic Statistics

X = X X n, + X 2

P (E) = P (A 1 )P (A 2 )... P (A n ).

Note that we are looking at the true mean, μ, not y. The problem for us is that we need to find the endpoints of our interval (a, b).

1 Basic continuous random variable problems

Bias Variance Trade-off

CS 124 Math Review Section January 29, 2018

Statistical testing. Samantha Kleinberg. October 20, 2009

Please bring the task to your first physics lesson and hand it to the teacher.

Business Statistics. Lecture 5: Confidence Intervals

Statistics, continued

Chapter 8: Confidence Intervals

Chapter 1 Review of Equations and Inequalities

MS&E 226: Small Data

Overview. Confidence Intervals Sampling and Opinion Polls Error Correcting Codes Number of Pet Unicorns in Ireland

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

MITOCW ocw f99-lec01_300k

Review. One-way ANOVA, I. What s coming up. Multiple comparisons

Confidence Intervals. - simply, an interval for which we have a certain confidence.

Experiment 2 Random Error and Basic Statistics

Lecture 20 Random Samples 0/ 13

What is a random variable

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019

Lecture 4: September Reminder: convergence of sequences

One-sample categorical data: approximate inference

Conditional Probability, Independence and Bayes Theorem Class 3, Jeremy Orloff and Jonathan Bloom

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

CS 361: Probability & Statistics

MITOCW ocw f99-lec30_300k

1.4 Techniques of Integration

Chapter 6. Estimates and Sample Sizes

Astronomical Distances. Astronomical Distances 1/30

PHP2510: Principles of Biostatistics & Data Analysis. Lecture X: Hypothesis testing. PHP 2510 Lec 10: Hypothesis testing 1

CS1800: Mathematical Induction. Professor Kevin Gold

Sampling Distribution Models. Central Limit Theorem

t-test for b Copyright 2000 Tom Malloy. All rights reserved. Regression

University of California, Berkeley, Statistics 134: Concepts of Probability. Michael Lugo, Spring Exam 1

Quantitative Understanding in Biology 1.7 Bayesian Methods

CS 160: Lecture 16. Quantitative Studies. Outline. Random variables and trials. Random variables. Qualitative vs. Quantitative Studies

Gov 2000: 6. Hypothesis Testing

Lecture 10: Powers of Matrices, Difference Equations

Introduction to Algebra: The First Week

1 Basic continuous random variable problems

CENTRAL LIMIT THEOREM (CLT)

CS 361: Probability & Statistics

Lab 5 for Math 17: Sampling Distributions and Applications

Finding Limits Graphically and Numerically

ASTRO 114 Lecture Okay. What we re going to discuss today are what we call radiation laws. We ve

Statistics and Quantitative Analysis U4320. Segment 5: Sampling and inference Prof. Sharyn O Halloran

Confidence Intervals for the Mean of Non-normal Data Class 23, Jeremy Orloff and Jonathan Bloom

Statistical inference provides methods for drawing conclusions about a population from sample data.

Probability Methods in Civil Engineering Prof. Dr. Rajib Maity Department of Civil Engineering Indian Institution of Technology, Kharagpur

chapter 1 function notebook September 04, 2015 Foundational Skills Algebra 1 Sep 8 8:34 AM

Your schedule of coming weeks. One-way ANOVA, II. Review from last time. Review from last time /22/2004. Create ANOVA table

Ch. 7: Estimates and Sample Sizes

Note that we are looking at the true mean, μ, not y. The problem for us is that we need to find the endpoints of our interval (a, b).

Math 140 Introductory Statistics

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

MITOCW ocw-18_02-f07-lec17_220k

Note: Please use the actual date you accessed this material in your citation.

Mock Exam - 2 hours - use of basic (non-programmable) calculator is allowed - all exercises carry the same marks - exam is strictly individual

MTH135/STA104: Probability

Probability and Discrete Distributions

Lecture 1: Probability Fundamentals

Multiple Regression Analysis

MITOCW watch?v=pqkyqu11eta

Making Sense. Tom Carter. tom/sfi-csss. April 2, 2009

LECTURE 15: SIMPLE LINEAR REGRESSION I

C if U can. Algebra. Name

MA554 Assessment 1 Cosets and Lagrange s theorem

Chapter 7: Sampling Distributions

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

the time it takes until a radioactive substance undergoes a decay

Sampling. Where we re heading: Last time. What is the sample? Next week: Lecture Monday. **Lab Tuesday leaving at 11:00 instead of 1:00** Tomorrow:

Precept 4: Hypothesis Testing

Are data normally normally distributed?

Exam 1 Solutions. Problem Points Score Total 145

Properties of Arithmetic

Alex s Guide to Word Problems and Linear Equations Following Glencoe Algebra 1

Hypothesis Testing. We normally talk about two types of hypothesis: the null hypothesis and the research or alternative hypothesis.

Methods of Mathematics

Probability and Statistics

Sampling Distributions. Introduction to Inference

ACMS Statistics for Life Sciences. Chapter 13: Sampling Distributions

1 MA421 Introduction. Ashis Gangopadhyay. Department of Mathematics and Statistics. Boston University. c Ashis Gangopadhyay

Chapter 7: Sampling Distributions

Transcription:

Last few slides from last time

Example 3: What is the probability that p will fall in a certain range, given p? Flip a coin 50 times. If the coin is fair (p=0.5), what is the probability of getting an estimate, p, greater than or equal to 0.7 (=35 heads). E(P ) = 0.5 Std. error(p ) = sqrt((.5)(.5)/50) =.0707 z = (0.7-0.5)/0.0707 2.83 P(z > 2.83) (1-0.9953)/2 = 0.0024 = P(p > 0.7) Pretty unlikely to get such high estimates of p

More examples on finding the mean and standard deviation of a r.v. x~n(µ x, σ x ), y~n(µ y, σ y ) Z = x + 4y + 2 E(Z) = E(x) + E(4y) + E(2) = µ x + 4µ y + 2 Var(Z) = var(x) + var(4y) + var(2) 2 = σ x 2 + 16 σ y Z = (2x 1 + 2x 2 -y)/5 E(Z) = (E(2x) + E(2x) - E(y))/5 = 4/5 µ x 1/5 µ y Var(Z) = var(2x/5) + var(2x/5) + var(y/5) = 8/25 σ x 2 + σ y2 /25

Confidence intervals 9.07 2/26/2004

From last time Sampling theory Start with a large population. Take a sample of N units from the population, and compute a statistic on that sample. E.G. statistic = sample mean = estimate of the population mean. We imagine doing this many times, and make deductions about how the sample statistic (estimator) is distributed.

The purpose of confidence intervals To estimate an unknown population parameter with an indication of how accurate the estimate is and of how confident we are that our estimate correctly captures the true value of the parameter.

Relationship of confidence intervals to sampling theory Confidence intervals Start with one sample of N units from a population. We make inferences from this one sample about the parameters of the underlying population.

Deduction: Reasoning from a hypothesis to a conclusion. Deduce properties of the sample statistic from knowledge of the population. population sample Induction: Reasoning from a set of observations to a reasonable hypothesis. Infer properties of the population parameter from knowledge of the sample.

Probability that the statistic takes on a particular range of values. Why confidence vs. probability? The population parameter has a true value, which either is or is not in the given range. population sample Confidence that the population parameter falls within a particular range of values.

Archery & confidence intervals Suppose you have an archer who can hit the 10 cm radius bull s eye 95% of the time. One arrow in 20 misses. 10cm

Archery & confidence intervals You look at the target from the back. The archer shoots a single arrow. Knowing the archer s ability, what can you say about where you expect the center of the bull s eye to be?

Archery & confidence intervals Well, 95% of the time, that arrow is going to be within 10cm of the center of the bull s eye. Thus, 95% of the time, the center of the bull s eye is going to be within 10cm of the arrow.

Archery & confidence intervals Draw a 10cm circle centered around the arrow. If you did this many times, your circles would include ( cover ) the center of the target 95% of the time. You are 95% confident that the center of the target lies in this circle. true center

Example: A Poll A pollster draws a random sample of 1000 voters and asks what they think of a candidate 550 voters favor the candidate What is the true proportion, p, of the population who favor the candidate? From our single sample, n=1000, p =.55

A Poll Recall the sampling distribution of P The distribution of P estimates, given the size of the sample, n, and the true population proportion, p. Approximately normal (especially for n=1000). E(P ) = p σ P' = sqrt(p(1-p)/ n)

A Poll From last time: what is the range of proportions such that we expect 95% of our p estimates to fall within this range? From the z-tables, and some algebra: 0.95 = P(-1.96 z 1.96) 0.95 = P(-1.96 (p -p)/ σ P' 1.96) 0.95 = P(p-1.96* σ P' p p+1.96* σ P' ) 95% of the p arrows land between p-1.96* σ P' and p+1.96* σ P'

A Poll More algebra: 0.95 = P(p-1.96* σ P' p p+1.96* σ P' ) 0.95 = P(p -1.96* σ P' p p +1.96* σ P' ) This says that 95% of the time, the true value of the population parameter, p, lies within p -1.96* σ P' and p +1.96* σ P' There s just one catch we don t know p, so we don t know σ P' =sqrt(p(1-p)/n).

A Poll We don t know σ P'. So, we fudge a bit, and approximate p by p. Then σ P' sqrt(p (1-p )/n) Back to the poll: p = 0.55, σ P' sqrt(.55*.45/1000) =.0157 We are 95% confident that p, the true % of the voters that favor the candidate, is within the range p ± 1.96 σ P' = 0.550 ± (1.96)(0.0157) =.550 ± 0.031 Polls will say, 55% favored the candidate, with a margin of error of 3%. (Polls typically use a 95% confidence level, just like we did here.)

Sample Distribution of P' Computer simulation of 20 samples of size n=1000. p Figure by MIT OCW. Red dots = estimates of p. Arrows indicate 95% confidence intervals. All intervals include the actual value of p, except this one. About 5%(1 in 20) of our confidence intervals will not cover the true value of p.

Note a subtle error on that last slide The picture of the 20 confidence intervals on the last slide was adapted from a book. It actually doesn t quite match the procedure we just followed. We estimated σ P' sqrt(p (1-p )/n) Confidence interval = ± 1.96 σ P' If we estimate σ P' we expect the width of the confidence interval to vary with our estimate of p.

A comment on the symmetry of sampling theory & confidence intervals 95% of the p arrows land between p-1.96 σ P' and p+1.96 σ P' 95% of the time, the true value of the population parameter, p, lies within p -1.96 σ P' and p +1.96 σ P' We get this symmetry because the normal distribution is symmetric about the mean (the parameter we are estimating).

Consider what would happen if parameter estimates had an asymmetric distribution 95% of estimates of µ fall within an asymmetric region. µ-l µ µ+r Suppose you observe estimate m.

Consider what would happen if parameter estimates had an asymmetric distribution Suppose you observe estimate m. If that estimate is < µ (i.e. to the left), then it must be pretty close to µ. Within l. m within l of the left of µ, => µ is within l of the right of m. µ-l µ µ+r m m+l

Consider what would happen if parameter estimates had an asymmetric distribution Suppose you observe estimate m. If that estimate is > µ (i.e. to the right), then m could be farther from µ. Within r. m within r of the right of µ, => µ is within r of the left of m. µ-l µ m-r µ+r m m+l

A Poll Suppose the candidate s campaign manager wants a smaller margin of error and greater confidence What can she do? There are basically two things she can do: 1. Increase confidence by widening the confidence interval (by going out more SEs) 2. Reduce the margin of error and/or increase confidence by polling more people

Increasing confidence By extending the margin of error ± 2SE from p, the pollster was able to arrive at approximately 95% confidence Using the standard z table, we can calculate that to get 99% confidence we need to extend the margin of error to ±2.58SE In our poll, the 99% confidence interval is p =.55 ±.041 With 99% confidence, more than ½ the voters favor the candidate In general, as you make the interval wider, you become more confident that the true value falls within your interval.

Reducing the margin of error So, we have increased our confidence that our interval straddles the true value of the parameter p to 99%. How do we reduce the margin of error from ±4% to, say, ±1%? Sample more people e = z crit sqrt(p (1-p )/n) For 99% confidence, z crit = 2.58. For 95% confidence, z crit = 1.96. The bigger the value of n, the smaller the e What n do we need to get e = 1%?

Aside: Notation You will often see the critical value of z, for a certain confidence, C, written z α/2, where α = (1-C/100). E.G. for 95% confidence, z 0.025 = 1.96 For 99% confidence, z 0.005 = 2.58

Area = C Area = 1-C 2 Area = 1-C 2 -z* 0 z* Figure by MIT OCW.

A Poll Rearranging n = [z 0.005 2 p* (1-p*)]/e 2 p* is a guess at the true proportion. This is a calculation we do before we do the survey -- we don t have our sample yet! Guess p* = 0.5 n = (2.58) 2 (.5) 2 /(.01) 2 = 16,641 1000 voters gave a 3% error with 95% confidence. To get 1% error with 99% confidence the candidate needs to sample 16,641 voters!

Polls, and increasing n 16,641 voters is a lot more surveys than 1000! Often, it s not worth it to increase n. Polls have response bias voters may not tell the truth when polled, they may not vote, or they may refuse to take part in the poll (and maybe the ones that refuse to take part are more likely to vote for the other guy). Poor people may not have phones and not be counted. These effects can be large, and taking a larger sample doesn t help. Gallup & other polling organizations instead try to reduce bias, by taking into account non-response, screening out eligible voters who are not likely to vote, and so on.

The margin of error of a confidence interval decreases as The confidence level decreases The sample size n increases The population standard deviation decreases

Confidence Intervals for µ Exactly the same logic works for estimating the mean value of a population Recall that the distribution of sample means is approximately normal with mean µ and standard error σ/sqrt(n) Just as before, σ is unknown, so we use s/sqrt(n) as an estimate -- the sample standard error

Confidence Intervals for µ So, by analogy, the interval m ± 1.96 SE(m) = m ± 1.96 s/sqrt(n) covers the true mean, µ, with about.95 probability m ± z α/2 SE(m) = m ± z α/2 s/sqrt(n) covers the true mean, µ, with about 1-α probability

Student s t (again) As we saw in the last lecture, if you don t know σ, you need to approximate it with the sample standard deviation, s. For large samples, the approximation is good, and it s as if you know σ. For small samples, use a t-distribution instead of a z-distribution. Computing confidence intervals is the same as in the z-distribution case, except you look up t crit in the t-distribution table, instead of z crit in the z- table.

Alcohol consumption: t-table example A researcher surveys 10 students, asking them how much alcohol they drink per week. The students consume an average of 3.4 units of alcohol/week, with a standard deviation of 4 units of alcohol. Assuming this was a simple random sample of MIT students, estimate with 95% confidence the mean alcohol/week consumed by an MIT student.

Alcohol consumption: t-table example We want an answer of the form mean ± margin of error The t-tables at the back of the book give the area under just one tail. If we want the area between the tails to be 95%, we look up α = area in one tail = (1-.95)/2 = 0.025 = 2.5% t.025 (n-1) = t.025 (9) = 2.26 t

Alcohol consumption: t-table example P(-2.26 t 2.26) = 0.95 = P(-2.26 (m-3.4)/(s/sqrt(n)) 2.26) = P(-2.26 (m-3.4)/(4/sqrt(10)) 2.26 So, with 95% confidence, the actual mean alcohol consumption is 3.4 ± 2.26 (4/sqrt(10) 3.4 ± 2.9 units

Making inferences about the population mean You survey 25 students taking a class with 3-0-9 credit units. For such a class, they are supposed to spend about 9 hours in homework and preparation for the class per week. The students spend on average 11 hours studying for this class, with a standard deviation of 4 hours. We want to know if the average number of hours spent studying for this class could still be 9 hours, or if this survey is evidence that the students are spending too much time on the class, and the class should be reclassified. Note that this is sort of the reverse of the problem from last class.

t-table vs. z-table We ll do this problem both ways (N=25 is on the border of what s acceptable for the z- table). In research, you ll almost always see t- tables used when estimating the mean, rather than trying to decide if N is big enough.

Inferences about the mean We want to know: what is the probability that the true average # hours spent studying is 9 or less, given that in our sample of 25 students, the average is 11 hours. =? 9 11 Mean hrs studying

Inferences about the mean: z-table 9 hrs is how many std. errors away from the mean of 11 hrs? Assume the standard deviation of the population equals the standard deviation of the data. Std. error of the mean = std. deviation of the data/sqrt(n) = 4/sqrt(25) = 4/5 z = (9-11)/(4/5) = -2.5 p(z<-2.5) = (1-0.9876)/2 = 0.0062

Inferences about the mean: z-table p(z<-2.5) = (1-0.9876)/2 = 0.0062 Put another way, we are >99% confident that the true mean hrs spent studying is >9 hrs. Probably this class is too much work for 3-0-9 credit hours.

Inferences about the mean: t-table 9 hrs is how many std. errors away from the mean of 11 hrs? s/sqrt(n) = 4/sqrt(25) = 4/5 t = (9-11)/(4/5) = -2.5 Degrees of freedom = 24 From our t-table, this roughly corresponds to a one-tailed area of 1% p(t<-2.5) 0.001

Inferences about the mean: t-table p(t<-2.5) 0.001 We are about 99% confident that the mean is greater than 9 hrs. This is slightly less confident than we were with the z-test, because the t-test takes into account that we don t really know the standard deviation of the population. It still seems highly unlikely that the true mean hrs spent studying is 9 hrs or fewer. Probably this class is too much work for 3-0-9 credit hours.

Another example of confidence intervals for proportions In an experiment, a subject is asked to discriminate which of two displays contains a target shape. On 50% of the trials the first display contains the target. On the remaining 50% of the trials, the target is in the second display. The subject does this task 50 times, and gets the answer right 65% of the time. What is the 99% confidence interval for the subject s performance? Does the interval contain 50% correct (chance performance)?

Percent correct on an experiment p = 0.65 = E(P ) Standard error = σ P' = sqrt(p (1-p )/n) = sqrt(0.65 0.35/50) 0.0675 From our z-tables, z crit 2.58 P(0.65 - z crit σ P' p 0.65 + z crit σ P ) = 0.99 So, the 99% confidence interval is approximately 0.48 p 0.82

Percent correct on an experiment With 99% confidence, 0.48 p 0.82 This range does include the 50% correct point (p=0.50). So, you cannot say, with 99% confidence, that you expect the subject to consistently perform better than chance on this task. What about the 95% confidence limits? z crit = 1.96 0.65 - z crit σ P' p 0.65 + z crit σ P 0.52 p 0.78 You are 95% confident that the subject s performance indicates that their abilities on the task are better than chance performance.

95% confidence limits on performance z crit = 1.96 of the experimental task 0.65-z crit σ P' p 0.65 + z crit σ P 0.52 p 0.78 You are 95% confident that the subject s performance indicates that their abilities on the task are better than chance performance.

Again, let s review the basic form for confidence intervals (for means and proportions) m ± 1.96 SE(m) covers the true mean, µ, with about.95 probability m ± z α/2 SE(m) = m ± z α/2 s/sqrt(n) covers the true mean, µ, with about 1-α probability zα/2 -> t α/2, for small samples p ± 1.96 SE(P ) covers the true proportion, p, with about.95 probability p ± z α/2 SE(P ) = p ± z α/2 sqrt(pq/n) covers the true proportion, p, with about 1-α probability

Standard error bars and plots You may have heard of standard error before this class, and you ve certainly seen it used. 1 0.75 0.5 0.25 0 Error bars = +/- one std. error = s/sqrt(n) 0.25.5.75

Some notes on error bars Think of each data point as being an estimate of some parameter of the population. 1 y 0.75 0.5 0.25 0 Estimate of expected value of y, given x=0.75 Estimate of expected value of y, given x=0.24 x 0.25.5.75

Some notes on error bars Then, we can make some inferences, just based on the graph. 1 0.75 y 0.5 0.25 0 We re 68% confident that the expected value of y for this x is > 0. 0.25.5.75 x

Some notes on error bars Then, we can make some inferences, just based on the graph. 1 0.75 y 0.5 0.25 These error bars are about the same size, and they just barely overlap. 0 0.25.5.75 x

Some notes on error bars Then, we can make some inferences, just based on the graph. 1 y 0.75 0.5 0.25 0 Therefore, these data points are about 2SE apart. Each falls just outside the 95% confidence interval of the other. (z crit = 1.96) 0.25.5.75 x

Some notes on error bars Then, we can make some inferences, just based on the graph. 1 y 0.75 0.5 0.25 0 You might think we could say something about being confident that the expected value for y 2 is different than the expected value for y 1 0.25.5.75 x