Statistics Notes

Math 121 - Fall 2026

Jump to: Math 121 homepage, Week 1, Week 2, Week 3, Week 4, Week 5, Week 6, Week 7, Week 8, Week 9, Week 10, Week 11, Week 12, Week 13, Week 14, Week 15

Week 1 Notes

Day Section Topic
Mon, Aug 24 1.2 Data tables, variables, and individuals
Wed, Aug 26 2.1.3 Histograms & skew
Fri, Aug 28 2.1.5 Boxplots

Mon, Aug 24

Today we covered data tables, individuals, and variables. We also talked about the difference between categorical and quantitative variables.

  1. We looked at a case of a nurse who was accused of killing patients at the hospital where she worked for 18 months. One piece of evidence against her was that 40 patients died during the shifts when she worked, but only 34 died during shifts when she wasn’t working. If this evidence came from a date table, what would be the most natural individuals (rows) & variables (columns) for that table?
  1. In the data table in the example above, who or what are the individuals? What are the variables and which are quantitative and which are categorical?

  2. If we want to compare states to see which are safer, why is it better to compare the rates instead of the total fatalities?

  3. What is wrong with this student’s answer to the previous question?

    Rates are better because they are more precise and easier to understand.

I like this incorrect answer because it is a perfect example of bullshit. This student doesn’t know the answer so they are trying to write something that sounds good and earns partial credit. Try to avoid writing bullshit. If you catch yourself writing B.S. on one of my quizzes or tests, then you can be sure that you a missing a really simple idea and you should see if you can figure out what it is.

Wed, Aug 26

We talked briefly about making bar charts for categorical data.

  1. Exercise 2.21

Then we introduced stem & leaf plots (stemplots) and histograms for quantitative data. We started by making a stemplot and a histogram for the weights of the students in the class. We also talked about how to tell if data is skewed left or skewed right.

  1. Can you think of a distribution that is skewed left?

  2. Why isn’t this bar graph from the book a histogram?

Then we did this workshop:

We finished by reviewing the mean and the median.

Fri, Aug 28

We introduced the five number summary and box-and-whisker plots (boxplots). We started by reviewing the median.

Median versus Average

The median of NN numbers is located at position N+12\dfrac{N+1}{2}.

The median is not affected by skew, but the average is pulled in the direction of the skew. So the average will be bigger than the median when the data is skewed right, and smaller when the data is skewed left.

We also talked about the interquartile range (IQR) and how to use the 1.5×IQR1.5 \times \text{IQR} rule to determine if data is an outlier. We also mentioned that a statistic is robust if it is not affected by skew and outliers. Both the median and the IQR are robust statistics.

We started with this simple example:

  1. An 8 man crew team actually includes 9 men, the 8 rowers and one coxswain. Suppose the weights (in pounds) of the 9 men on a team are as follows:

     120  180  185  200  210  210  215  215  215

    Find the 5-number summary and draw a box-and-whisker plot for this data. Is the coxswain who weighs 120 lbs. an outlier?


Week 2 Notes

Day Section Topic
Mon, Aug 31 2.1.4 Standard deviation
Wed, Sep 2 4.1 Normal distribution
Fri, Sep 4 4.1.4 Normal distribution computations

Mon, Aug 31

We also introduced the standard deviation. We did this one example of a standard deviation calculation by hand, but you won’t ever have to do that again in this class.

  1. 11 students just completed a nursing program. Here is the number of years it took each student to complete the program. Find the standard deviation of these numbers.

     3  3  3  3  4  4  4  4  5  5  6

From now on we will just use software to find standard deviation. In a spreadsheet (Excel or Google Sheets) you can use the =STDEV() function.

  1. Which of the following data sets has the largest standard deviation?

    1. 1000, 998, 1005
    2. 8, 10, 15, 20, 22, 27
    3. 30, 60, 90

We finished by looking at some examples of histograms that have a shape that looks roughly like a bell. This is a very common pattern in nature that is called the normal distribution.

The normal distribution is a mathematical model for data with a histogram that is shaped like a bell. The model has the following features:

  1. It is symmetric (left & right tails are same size)
  2. The mean (μ\mu) is the same as the median.
  3. It has two inflection points (the two steepest points on the curve)
  4. The distance from the mean to either inflection point is the standard deviation (σ\sigma).
  5. The two numbers μ\mu and σ\sigma completely describe the model.

The normal distribution is a theoretical model that doesn’t have to perfectly match the data to be useful. We use Greek letters μ\mu and σ\sigma for the theoretical mean and standard deviation of the normal distribution to distinguish them from the sample mean x‾\bar{x} and standard deviation ss of our data which probably won’t follow the theoretical model perfectly.

Wed, Sep 2

We talked about z-values and the 68-95-99.7 rule.

We also did these exercises before the workshop.

  1. In 2020, Farmville got 61 inches of rain total (making 2020 the second wettest year on record). How many standard deviations is this above average?

  2. The average high temperature in Anchorage, AK in January is 21 degrees Fahrenheit, with standard deviation 10. The average high temperature in Honolulu, HI in January is 80°F with σ = 8°F. In which city would it be more unusual to have a high temperature of 57°F in January?

Fri, Sep 4

Today we used the Probability Distributions app (android version, iOS version) to calculate normal distribution probabilities.

  1. (Percent below) SAT verbal scores are roughly normally distributed with mean μ = 500, and σ = 100. Estimate the percentile of a student with a 560 verbal score.

  2. (Percent above) What percent of students get above a 560 verbal score on the SATs?

  3. (Percent to locations) What SAT score is in the 90th percentile?

  4. (Percent between) What percent of years do we get between 40 and 50 inches of rain in Farmville?

We also talked about the probability shorthand notation P(X<x)P(X < x) which literally means “the probability that the outcome X is less than x”. Then we did this workshop.


Week 3 Notes

Day Section Topic
Mon, Sep 7 No class (Labor day)
Wed, Sep 9 2.1, 8.1 Scatterplots and correlation
Fri, Sep 11 8.2 Least squares regression introduction

Wed, Sep 9

We introduced scatterplots and correlation coefficients with these examples:

  1. What would the correlation between husband and wife ages be in a country where every man married a woman exactly twice his age?

Important concept: correlation does not change if you change the units or apply a simple linear transformation to the axes. Correlation just measures the strength of the linear trend in the scatterplot.

Another thing to know about the correlation coefficient is that it only measures the strength of a linear trend. The correlation coefficient is not as useful when a scatterplot has a clearly visible nonlinear trend.

We finished by introducing the least squares regression line which has these features:

  1. Slope m=Rsysxm = R \frac{s_y}{s_x}
  2. Point (x‾,y‾)(\bar{x}, \bar{y})

The two main applications of a least squares regression line are:

It is important to be able to describe the units of the slope.

  1. What are the units of the slope of the regression line for predicting BAC from the number of beers someone drinks?

Fri, Sep 11

We started by deriving the slope-intercept formula for a least squares regression line.

Least Squares Regression Line

y=mx+by = m x + b

where m=Rsysxm = R \frac{s_y}{s_x} is the slope and b=y‾−mx‾b = \bar{y} - m \bar{x} is the y-intercept.

  1. What are the slope and y-intercept to predict someone’s weight based on their height?

  2. What are the units of the slope for predicting someone’s weight from their height?

We also introduced the following concepts.

The coefficient of determination. R2R^2 represents the proportion of the variability of the yy-values that follows the trend line. The remaining 1−R21-R^2 represents the proportion of the variability that is above and below the trend line.

Regression to the mean. Extreme xx-values tend to have less extreme predicted yy-values in a least squares regression model.

  1. The regression line for predicting midterm 2 grades based on midterm 1 is: y=0.58x+29.7.y = 0.58 x + 29.7. with a coefficient of determination R2=0.371R^2 = 0.371.

    1. What is the predicted average midterm 2 grade for students who got a 100 on midterm 1?
    2. What is the predicted average midterm 2 grade for students who got a 50 on midterm 1?
    3. What percent of the variability in midterm 2 grades is not predicted by midterm 1 grades?

Week 4 Notes

Day Section Topic
Mon, Sep 14 8.2 Least squares regression practice
Wed, Sep 16 1.3 Sampling: populations and samples
Fri, Sep 18 1.3 Bias versus random error

Mon, Sep 14

Before the workshop, we started with this warm-up exercise.

  1. Suppose that the correlation between the heights of fathers and adult sons is R=0.5R = 0.5. Given that both fathers and sons have normally distributed heights with mean 7070 inches and standard deviation 3 inches, find an equation for the least squares regression line.

Wed, Sep 16

We talked about the difference between samples and populations. The central problem of statistics is to use sample statistics to answer questions about population parameters.

We looked at an example of sampling from the Gettysburg address, and we talked about the central problem of statistics: How can you answer questions about the population using samples?

The reason this is hard is because sample statistics usually don’t match the true population parameter. There are two reasons why:

We looked at this case study:

Important Concepts

  1. Bigger samples have less random error.

  2. Bigger samples don’t reduce bias.

  3. The only sure way to avoid bias is a simple random sample.

We finished with this practice problem:

  1. Suppose you want to determine the percent of grocery stores that carry a specific brand of pasta. To find out, you visit a random selection of nearby grocery stores. In this situation, identify the following:

    1. The population
    2. The sample
    3. The variable(s) of interest
    4. The statistic
    5. The parameter

Fri, Sep 18

We did this workshop.


Week 5 Notes

Day Section Topic
Mon, Sep 21 1.4 Randomized controlled experiments
Wed, Sep 23 Review
Fri, Sep 25 Midterm 1

Mon, Sep 21

One of the hardest problems in statistics is to prove causation. Here is a diagram that illustrates the problem.

The explanatory variable might be the cause of a change in the response variable. But we have to watch out for other variables that aren’t part of the study called lurking variables. When researchers take a variable into account in a study, we say it is controlled.

A lurking variable that might be associated with both the explanatory and response variable is called a confounding variable.

We say that correlation is not causation because you can’t assume that there is a cause and effect relationship between two variables just because they are strongly associated. The association might be caused by lurking variables or the causal relationship might go in the opposite direction of what you expect.

Experiments versus Observational Studies

An experiment is a study where individuals are put into different treatment groups. An experiment is randomized if the individuals are randomly assigned to the treatment groups. An observational study is one where the researchers do not place the individuals into different treatment groups.

Proving Cause and Effect

We looked at these examples.

  1. A study tried determine whether cellphones cause brain cancer. The researchers interviewed 469 brain cancer patients about their cellphone use between 1994 and 1998. They also interviewed 469 other hospital patients (without brain cancer) who had the same ages, genders, and races as the brain cancer patients.

    1. What was the explanatory variable?
    2. What was the response variable?
    3. Which variables were controlled?
    4. Was this an experiment or an observational study?
    5. Are there any possible lurking variables?
  2. In 1954, the polio vaccine trials were one of the largest randomized controlled experiments ever conducted. Here were the results.

    1. What was the explanatory variable?
    2. What was the response variable?
    3. This was an experiment because it had a treatment variable. What was that?
    4. Which variables were controlled?
    5. Why don’t we have to worry about lurking variables?

We talked about why the polio vaccine trials were double blind and what that means.

  1. Do magnetic bracelets work to help with arthritis pain?

    1. What is the explanatory variable?
    2. What is the response variable?
    3. How hard would it be to design a randomized controlled experiment to answer the question above?

We finished by talking about anecdotal evidence.

Wed, Sep 23

We talked about the midterm 1 review problems.


Week 6 Notes

Day Section Topic
Mon, Sep 28 3.1 Defining probability
Wed, Sep 30 3.1 Multiplication and addition rules
Fri, Oct 2 3.4 Weighted averages & expected value

Mon, Sep 28

Today we introduced probability models which always have two parts:

  1. A list of possible outcomes called a sample space.
  2. A probability function P(E)P(E) that gives the probability for any subset EE of the sample space.

A subset of the sample space is called an event. We already intuitively know lots of probability models, for example we described the following probability models:

  1. Flip a coin.

  2. Roll a six-sided die.

  3. If you roll a six-sided die, what is P(result at least 5)?P(\text{result at least 5})?

  4. The proportion of people in the US with each of the four blood types is shown in the table below.

    Type O A B AB
    Proportion 0.45 0.40 0.11 ?

    What is P(Type AB)?P(\text{Type AB})?

Wed, Sep 30

Today we talked about the multiplication and addition rules for probability. We also talked about independent events and conditional probability. We started with these examples.

  1. If you roll two six-sided dice, the results are independent. What is the probability that both dice land on a six?

  2. Suppose you shuffle a deck of 52 playing cards and then draw two cards from the top. Find

    1. P(First card is an ace)P(\text{First card is an ace})
    2. P(Second card is an ace | first is an ace)P(\text{Second card is an ace } | \text{ first is an ace})
    3. P(Second card is an ace | first is not an ace)P(\text{Second card is an ace } | \text{ first is not an ace})

Then we did this workshop:

Fri, Oct 2

Today we talked about weighted averages. To find a weighted average:

  1. Multiply each number by its weight.
  2. Add the results.

We did this workshop.

Before that, we did some examples.

  1. Calculate the final grade of a student who gets an 89 quiz average, 73 midterm average, 90 project average, and an 81 on the final exam.

  2. Eleven nursing students graduated from a nursing program. Four students completed the program in 3 years, four took 4 years, two took 5 years, and one student took 6 years to graduate. Express the average time to complete the program as a weighted average.

The expected value (also known as the theoretical average) is the weighted average of the outcomes in a probability model, using the probabilities as the weights.

  1. Here is a probability model for how many hurricanes hit Virginia each year. What is the expected number of hurricanes per year?
# of Hurricanes 0 1 2 3
Probability 0.65 0.28 0.06 0.01
  1. What is the expected value if you roll a six-sided die?

The Law of Large Numbers. When you repeat a random experiment many times, the sample mean x‾\bar{x} tends to get closer to the theoretical average μ\mu.


Week 7 Notes

Day Section Topic
Mon, Oct 5 3.4 Discrete versus continuous distributions
Wed, Oct 7 7.1 Sampling distributions
Fri, Oct 9 5.1 Sampling distributions for proportions

Mon, Oct 5

We started with these warm-up problems.

  1. What is the expected value from the raffle tickets example in the workshop from Friday?

  2. Last time we calculated the expected value if you play roulette and bet $1 on a color like black. If you bet $1 on a number, like 7, then you only have a 1/38 chance of winning, but you get $36 if you win. Find the expected value for this bet.

After that we introduced the binomial distribution which is the distribution of the possible number of successes if you do N independent random trials that each have a probability p of a success.

The binomial distribution is an example of a discrete distribution which means that there are only finitely many possible outcomes between any two values. The normal distribution is an example of a continuous distribution which can have an infinite range of possible outcomes between two values.

Every probability distribution can be described by three things:

  1. If you play 100 games of roulette and bet on black every time, then the distribution for the amount of money you might get is approximately normal with μ=$94.7\mu = \$94.7 and σ≈$10\sigma \approx \$10. Use the normal distribution to approximate the probability that you win more money than you lose (i.e., win more than $100)

  2. Suppose you play 100 games of roulette and bet on 7 every time. In this case μ=$94.7\mu = \$94.7, σ=$57.6\sigma = \$57.6, but the distribution is definitely not normal! Use the binomial distribution app to find the probability that you win more money than you lose. Which is a better strategy, betting on one number or one color?

Another example of a discrete probability distribution is the total when you roll one or more dice.

We finished by talking about the trade-off between risk (σ\sigma) versus expected returns (μ\mu) when investing.

Wed, Oct 7

Suppose we are trying to study a large population with mean μ\mu and standard deviation σ\sigma. If we take a random sample, the sample mean x‾\bar{x} is a random variable and its probability distribution is called the sampling distribution of x‾\bar{x}. Assuming that the population is large and our sample is a simple random sample, the sampling distribution always has the following features:

Sampling Distribution of x‾\bar{x}

  1. Shape: gets more normal as the sample size NN gets larger.
  2. Center: the theoretical average of x‾\bar{x} is the true population mean μ\mu.
  3. Spread: the theoretical standard deviation of x‾\bar{x} gets smaller as NN gets bigger. In fact: σx‾=σN.\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{N}}.

Examples of sampling distributions.

  1. Every week in the Fall there are about 15 NFL games. In each game, there are about 13 kickoffs, on average. So we can estimate that there might be about 200 kickoffs in one week of NFL games. Those 200 kickoffs would be a reasonably random sample of all NFL kickoffs. Describe the sampling distribution of the average kickoff distance.

  2. The average American weighs μ=170\mu = 170 lbs. with a standard deviation of σ=40\sigma = 40 lbs. If an airplane is designed to seat 22 passengers, what is the probability that the combined weight of the passengers would be greater than 4,000 lbs? Hint: This is the same as finding P(x‾>181.8).P(\bar{x} > 181.8).

Fri, Oct 9

We talked about sample proportions which are denoted p̂\hat{p} and can be found using the formula p̂= number of "successes" sample size .\hat{p} = \frac{\text{ number of "successes" }}{\text{ sample size }}. In a SRS from a large population, p̂\hat{p} is random with a sampling distribution that has the following features.

Sampling Distribution of p̂\hat{p}

  1. Shape: gets more normal as the sample size NN gets larger.
  2. Center: the theoretical average of p̂\hat{p} is the true population proportion pp.
  3. Spread: the theoretical standard deviation of p̂\hat{p} gets smaller as NN gets bigger. σp̂=p(1−p)N.\sigma_{\hat{p}} = \sqrt{\frac{p(1-p)}{N}}.

We did the following exercises in class.

  1. This semester, 28 out of 54 students in my statistics class were born in VA. Is 2854\frac{28}{54} a statistic or a parameter? Should you denote it as pp or p̂\hat{p}?

  2. In the United States about 7.2% of people have type O-negative blood, so they are universal donors. Is 7.2% a parameter (pp) or a statistic (p̂\hat{p})?

  3. If a hospital has N=900N = 900 patients, describe the sampling distribution for the proportion of patients who are universal donors.

  4. Find the probability that P(p̂universal donor>8%)P(\hat{p}_{\text{universal donor}} > 8\%).


Week 8 Notes

Day Section Topic
Mon, Oct 12 No class (Fall break)
Wed, Oct 14 5.2 Confidence intervals for a proportion
Fri, Oct 16 5.2 Confidence intervals for a proportion - con’d

Wed, Oct 14

Today we introduced confidence intervals for proportions. These are based on a simple idea: there is a 95% chance that the sample proportion p̂\hat{p} is no more than 2 standard deviations away from the true population proportion pp.

Confidence Interval for a Proportion

p̂±z*p̂(1−p̂)N.\hat{p} \pm z^* \sqrt{\dfrac{\hat{p} ( 1 - \hat{p} )}{N} }.

Works best if there are at least 15 “successes” and 15 “failures” in the sample.

The variable z*z^* is called the critical z-value is determined by the desired confidence level. Here are some common choices.

Confidence Level 90% 95% 99% 99.9%
Critical z-value (z*z^*) 1.645 1.96 2.576 3.291

In order to trust a confidence interval, you need these two assumptions to hold:

  1. No Bias. The data should come from a simple random sample to avoid bias.

  2. Normality. The sample size must be large enough for p̂\hat{p} to be normally distributed. A rule of thumb (the success-failure condition) is that you should have at least 15 “successes” and 15 “failures” in the sample.

We did the following examples in class.

  1. In my statistics classes 28 out of 54 students were born in VA. Use the 95% confidence interval formula to estimate the percent of all HSC students that were born in VA.

  2. In 2004 the General Social Survey found 304 out 977 Americans always felt rushed. Find the 90% confidence interval for the proportion of Americans who always feel rushed.

  3. What are we 90% sure is true about the confidence interval we found? Only one of the following is the correct answer. Which is it?

    1. 90% of Americans are in the interval.
    2. 90% of future samples will have results in the interval.
    3. 90% sure that the population proportion is in the interval.
    4. 90% sure that the sample proportion is in the interval.

A confidence interval has two parts: a best guess estimate (or point estimate) before the plus/minus symbol, and a margin of error after the ±\pm symbol.

  1. About one third of American households have a pet cat. How large of a sample would be need if you wanted to make a 95% confidence interval with a margin of error less than 1% for the percent of households with a pet cat?

Fri, Oct 16

Last time we introduced confidence intervals for proportions. Today we did some more examples related to confidence intervals.

  1. A 2017 Gallop survey of 1,011 American adults found that 38% believe that God created man in his present form. Find a 95% confidence interval to estimate the percent of all Americans who share this belief.

  2. A university newspaper is conducting a survey to determine what fraction of students support a $200 a year increase in fees to pay for a new football stadium. How big of a sample is required to ensure the margin of error is smaller than 0.04 using a 95% confidence level?

  3. One of our first examples of sampling was the Literary Digest magazine poll from the 1936 presidential election. They had a huge sample with 2.4 million responses. In that sample, 62% supported Alfred Landon (R) over FDR (D). What is the margin of error for a 99% confidence interval with this data?

  4. How is it possible that the margin of error could be so small if the poll was so wrong?


Week 9 Notes

Day Section Topic
Mon, Oct 19 5.3 Hypothesis testing for a proportion
Wed, Oct 21 Review
Fri, Oct 23 Midterm 2

Mon, Oct 19

Today we introduced hypothesis testing. This is a tool for answering yes/no questions about a population parameter. We started with this example:

  1. Once I took a test to see if I had psychic powers. In the test, I had 25 chances to guess which one of five symbols was on 25 different Zenner cards (see below) that I couldn’t see. If I were just guessing, I would only have a 20% chance (1 out of 5) of guessing right. But I actually got 10 out of 25 guesses correct. How strong is this evidence that I am psychic?
Zenner cards (Source: Wikipedia)

Every hypothesis test starts with two possibilities:

Here are the steps to do a hypothesis test for a single proportion:

  1. State the hypotheses. These will pretty much always look like

  2. Calculate the test statistic. Using the formula z=p̂−p0p0(1−p0)N.z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{N}}}.

  3. Find the p-value. The p-value is the probability of getting a result at least as extreme as the test statistic if the null hypothesis is true.

  4. Explain what it means. A low p-value is evidence that we should reject the null hypotheses. Usually this means that the results are too surprising to be caused by random chance along. A p-value over 5% means the results might be a random fluke and we should not reject H0H_0.

p-value Meaning
Over 5% Weak evidence
1% to 5% Moderate evidence
0.1% to 1% Strong evidence
Under 0.1% Very strong evidence

We finished with a second hypothesis test example.

  1. This year 7 out of 25 (28%) of the students in our statistics class were born in VA. Is this strong evidence that less than half of all HSC students were born in VA? State the hypotheses, find the z-value, find the p-value, and explain what it means.

Wed, Oct 21

We talked about the midterm 2 review in class today. The solutions are online now too.


Week 10 Notes

Day Section Topic
Mon, Oct 26 6.1 Inference for a single proportion
Wed, Oct 28 5.3.3 Decision errors
Fri, Oct 30 6.2 Difference of two proportions (hypothesis tests)

Mon, Oct 26

Today we talked about hypothesis testing again.

One-Sample Hypothesis Test for a Proportion

H0:p=p0HA:p≠p0\begin{array}{lr} H_0: & p = p_0 \\ H_A: & p \ne p_0 \end{array}
           
z=p̂−p0p0(1−p0)N.z = \dfrac{\hat{p} - p_0}{\sqrt{\frac{p_0 (1 - p_0)}{N}}}.

This works best if you have at least 10 expected “successes” and 10 expected “failures”.

We started with this example:

  1. In 2013, a random sample of 1028 U.S. adults found that 56% support nuclear arms reduction. Does this provide strong evidence that a majority of Americans support nuclear arms reduction?

We talked about how the null hypotheses must give a specific value for the parameter of interest so that we can create a null model that we can test. If the sample statistic is far from what we expect, then we can reject the null hypothesis and say that the results are statistically significant. Unlike in English, the word significant does not mean “important” in statistics. It actually means the following.

Logic of Hypothesis Testing. The following are all equivalent:

  1. Results are statistically significant.
  2. We should reject the null hypothesis.
  3. Low p-value (at least under 5%).
  4. Results are probably not a random fluke.

Notice that all of the items on the list above are statistics jargon except the last.

Watch out: When the evidence is weak, we don’t accept the null hypothesis. We just say the results are inconclusive and we fail to reject the null hypothesis.

We finished with these exercises from the book.

  1. Exercise 5.16(b)

Notice that in 5.16(b), you could make the case that we have prior knowledge based on the reputation of the state of Wisconsin to guess that that percent of people who have drank alcohol in the last year in Wisconsin (which we denoted pWIp_\text{WI}) satisfies a one-sided alternative hypothesis: HA:pWI>70%.H_A ~:~ p_\text{WI} > 70\%. If you don’t know about Wisconsin, then you should definitely use the two-sided alternative hypothesis: HA:pWI≠70%H_A ~:~ p_\text{WI} \ne 70\% The only difference is when you calculate the p-value, you use two tails of the bell curve if you are doing a two-sided p-value. If you aren’t sure, it is always safe to use a two-sided alternative.

  1. Exercise 5.17

Wed, Oct 28

When we do a hypothesis test, we need to make sure that the assumptions of a hypothesis test are satisfied. There are two that we need to check:

  1. No Bias. Data should come from a simple random sample (SRS) from the population.
  2. Normality. Sample size should be large enough to trust that p̂\hat{p} will be normally distributed. Based on the p0p_0 from the null hypothesis, you should expect at least 10 success and 10 failures. So you need both np0≥10 and n(1−p0)≥10.n p_0 \ge 10 \text{ and } n (1-p_0) \ge 10.

Significance Levels

Another thing you have to decide when you do a hypothesis test is how strong the evidence needs to be in order to convince you to reject the null hypothesis. Historically people aimed for a significance level of α=5%\alpha = 5\%. A p-value smaller than that was usually considered strong enough evidence to reject H0H_0. Now people often want stronger evidence than that, so you might want to aim for a significance level of α=1%\alpha = 1\%. In some subjects like physics where things need to be super rigorous they use even lower values for α\alpha. Unlike the p-value, you pick the significance level α\alpha before you look at the data.

Types of Errors

In the back of your mind, remember there are four possible things that might happen in a null hypothesis.
H0H_0 is true HAH_A is true
p-value below α\alpha Type I error (false positive) Reject H0H_0
p-value above α\alpha Don’t reject H0H_0 Type II error (false negative)

If H0H_0 is true, then the significance level α\alpha that you choose is the probability that you will make a type I error which is when you reject H0H_0 when you shouldn’t. The disadvantage of making α\alpha really small is that it does increase the chance of a type II error which is when you don’t reject H0H_0 even though you should.

In a criminal trial the prosecution tries to prove that the defendant is “guilty beyond a reasonable doubt”. Think of a type I error as when the jury convicts an innocent defendant. A type II error would be if the jury does not convict someone who is actually guilty.

  1. If I’m not psychic, but I make enough lucky guesses with Zener cards, it might look like strong evidence that I am pyschic. What type of error is this?

  2. This semester, 28 out of 54 students in my statistics classes were born in Virginia. This turns out to be inconclusive evidence if we want to reject the null hypothesis that exactly half of HSC students are from Virginia. What type of error might we be making if we don’t reject the null?

Comparing Two Proportions

After that, we rushed a bit at the end to squeeze in this example.

  1. In the 2008 General Social Survey, people were asked to rate their lives as exciting, routine, or dull. 300 out of 610 men in the study said their lives were exciting versus 347 out of 739. Is that strong evidence that there is a difference between the proportions of men and women who find their lives exciting?

We introduced a little theory that we needed to answer this question. In a large enough random sample from two populations A and B, the gap between the sample proportions p̂A−p̂B\hat{p}_A - \hat{p}_B has a sampling distribution with:

Based on this, we estimated a standard deviation of about 2.7% so our sample gap of 2.2% is not very strong evidence that men and women have significantly different opinions about how exciting their lives are.

Fri, Oct 30

Two-Sample Hypothesis Test for Proportions

H0:pA=pBHA:pA≠pB\begin{array}{lr} H_0: & p_A = p_B \\ H_A: & p_A \ne p_B \end{array}
           
z=p̂A−p̂Bp̂(1−p̂)(1nA+1nB).z = \dfrac{\hat{p}_A - \hat{p}_B}{\sqrt{\hat{p} (1 - \hat{p})\left( \frac{1}{n_A} + \frac{1}{n_B} \right)}}.

where p̂\hat{p} is the pooled proportion: p̂= Total number of successes in both samples nA+nB.\hat{p} = \frac{\text{ Total number of successes in both samples }}{n_A + n_B}.

This test requires at least 5 successes and 5 failures in each group to be trustworthy.

  1. In 2012, the Atheist Shoe Company noticed that packages they sent to customers in the USA were getting lost in the mail. So they did an experiment. They mailed 89 packages that were clearly labeled with the Atheist brand logo, and they also sent 89 unmarked packages in plain boxes. 9 out of the 89 labeled packages did not arrive on time compared with only 1 out of 89 unlabeled packages. Is that a statistically significant difference? (See this website for more details: Atheist shoes experiment)

As with any statistical inference method, the 2-sample test for proportions is based on two key assumptions:

If you want to estimate how big the gap between the population proportions pAp_A and pBp_B is, then use:

Two-Sample Confidence Interval for Proportions

(p̂A−p̂B)±z*p̂A(1−p̂A)NA+p̂B(1−p̂B)NB.(\hat{p}_A - \hat{p}_B) \pm z^* \sqrt{\frac{\hat{p}_A (1-\hat{p}_A)}{N_A} + \frac{\hat{p}_B (1- \hat{p}_B)}{N_B}}.

Works best if both samples contain at least 10 successes and 10 failures.

Because the formulas for two-sample confidence intervals and hypothesis tests are so convoluted, I recommend using the Desmos calculator, especially on the projects to make sure everything is entered correctly.


Week 11 Notes

Day Section Topic
Mon, Nov 2 6.2.3 Difference of two proportions (confidence intervals)
Wed, Nov 4 7.1 Introducing the t-distribution
Fri, Nov 6 7.1.4 One sample t-confidence intervals

Mon, Nov 2

We started with this example of a two-sample hypothesis test.

  1. A study in the early 1990s looked at whether the anti-retroviral drug AZT is effective at preventing HIV-positive pregnant women from passing the HIV virus on to their children. In the study, 13 out of 180 babies whose mothers were given AZT while pregnant tested postive for HIV, compared with 40 out of 183 babies whose mothers got a placebo. Is this strong evidence that AZT is effective? How much of a difference does it make?

Then we did this workshop.

Wed, Nov 4

Today we started talking about how to do inference about a quantitative variable like height. This semester, my statistics students have an average height of 71.5 inches with a standard deviation of 2.8 inches. This is data from 54 students. This suggests that maybe Hampden-Sydney students are taller than average for men in the United States. So we made these hypotheses:

To test these, we reviewed what we know about the sampling distribution for x‾\bar{x}, and we tried to find the z-value using the formula z=x‾−μ0σ/n.z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}. Unfortunately, we don’t know the population standard deviation σ\sigma for all HSC students. We only know the sample standard deviation. If we use that instead of σ\sigma, then we get a t-value: t=x‾−μ0s/n.t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}. which follows a t-distribution. We talked about how to use the t-distribution app to calculate probabilities on a t-distribution. One weird thing about t-distributions is that they have degrees of freedom (denoted by either df or ν\nu). When you do a hypothesis test for one mean or a confidence interval for one mean, degrees of freedom=n−1.\text{degrees of freedom} = n - 1.

One-Sample Hypothesis Test for Means

H0:μ=μ0HA:μ≠μ0\begin{array}{lr} H_0: & \mu = \mu_0 \\ H_A: & \mu \ne \mu_0 \end{array}
           
t=x‾−μ0s/n.t = \dfrac{\bar{x} - \mu_0}{s / \sqrt{n}}.

The tt-value has n−1n-1 degrees of freedom.

This test works best if the sample size is large (at least 30) or there is very little skew and no outliers in the sample.

We briefly talked about why this is. Then we used the app to find a p-value for our class data and see whether or not we have strong evidence that HSC students are taller on average than other men in the USA. The logic of p-values is exactly the same for a t-test as it is for a hypothesis test with the normal distribution.

We finished with this example:

  1. In 2017, the median home price in the USA was $254,900\$254{,}900. Is there strong evidence that the average home price in Farmville, VA is lower than this number? Here is data from a random sample of 10 homes that sold in Farmville in 2017: n=10,s=$76,550,x‾=$161,900.n = 10, ~~~~~ s = \$76{,}550, ~~~~~ \bar{x} = \$161{,}900. Carry out a hypothesis test with this data to answer the question.

We finished by introducing confidence intervals for means.

One-Sample Confidence Interval for a Mean

x‾±t*sn\bar{x} \pm t^* \frac{s}{\sqrt{n}}

where t*t^* is the critical t-value which has n−1n-1 degrees of freedom.

This works best if the sample size is large (at least 30) or there is very little skew and no outliers in the sample.

Fri, Nov 6

The easiest way to find the critical t-value for a confidence interval is to use a table:

We talked about how to use the table to find tt-values. Then we did the following examples.

  1. Use the class data to make a 95% confidence interval for the average height of all HSC students.

  2. Use the class data class data to make a 90% confidence interval for the average weight of all HSC students. Are the conditions for making a confidence interval satisfied?

We also did this workshop.

t-distribution methods (both confidence intervals & hypothesis tests) require the following assumptions:

  1. No Bias. Data should be a simple random sample from the population.

  2. Normality. The sampling distribution for x‾\bar{x} should be normal. This tends to be true if the sample size is big. Here is a quick rule of thumb:


Week 12 Notes

Day Section Topic
Mon, Nov 9 7.2 Paired data
Wed, Nov 11 7.3 Difference of two means
Fri, Nov 13 7.3 Difference of two means - con’d

Mon, Nov 9

We talked about comparing the averages of two correlated variables. You can use one sample t-distribution methods to do this as long as you focus on the matched pairs differences. The key is to focus on the difference or gap between the variables. For a matched pairs t-test, we always use the following:

Hypotheses Test Statistic
H0:μdifference=0HA:μdifference≠0\begin{array}{l} H_0: \mu_\text{difference} = 0 \\ H_A: \mu_\text{difference} \ne 0 \end{array} t=x‾difference−0s/Nt = \dfrac{~ \bar{x}_\text{difference} - 0 ~}{s/\sqrt{N}}
  1. Does the data in this sample of couples getting married provide significant evidence that husbands are older than their wives on average? What is the average age gap? Use a one-sample hypothesis test and confidence interval for the average difference.

  2. Are the necessary assumptions for a t-test and a t-confidence interval satisfied in the previous example?

  3. Make a confidence interval for the average age gap between husbands and wives. It turns out that the 95% confidence interval tells us that husbands are from −0.125-0.125 to 3.9753.975 years older on average. Since this interval extends farther on one side than the other, we might be tempted to argument that men really are older on average, but you can’t make this argument based on the confidence interval.

  4. Do helium filled footballs go farther when you kick them? An article in the Columbus Dispatch from 1993 described the following experiment. One football was filled with helium and another identical football with regular air. Each football was kicked 39 times and the two footballs alternated with each kick. The distances traveled by the balls on each kick is recorded in this spreadsheet: Helium filled footballs.

    Does this data provide statistically significant evidence that helium filled footballs go farther when kicked?


Week 13 Notes

Day Section Topic
Mon, Nov 16 Choosing the right technique
Wed, Nov 18 Review
Fri, Nov 20 Midterm 3

Week 14 Notes

Day Section Topic
Mon, Nov 23 7.4 Statistical power
Wed, Nov 25 No class (Thanksgiving break)
Fri, Nov 27 No class (Thanksgiving break)

Week 15 Notes

Day Section Topic
Mon, Nov 30 6.3 Chi-squared statistic
Wed, Dec 2 6.4 Testing association with chi-squared
Fri, Dec 4 Chi-squared caveats
Mon, Dec 7 Last day, recap & review