Confidence Intervals, Hypothesis Testing & Chi-square test

ANTH 504

1.

Previously, we created this data set which represents the amount of time (in seconds) that it takes 21 heavy smokers to fall off a treadmill at the fastest setting:

twentyone_smokers <- c(18, 16, 18, 24, 23, 22, 22, 23, 26, 29, 32, 34, 34, 36, 36, 43, 42, 49, 46, 46, 57)
hist(twentyone_smokers)

Calculate:

The standard error

mean_val <- mean(twentyone_smokers)
n <- length(twentyone_smokers)
n
## [1] 21
sd <- sd(twentyone_smokers)
sd
## [1] 11.58714
se <- sd / sqrt(n)
se
## [1] 2.528522

The 95% confidence interval

df <- n-1
tscore_95 <- qt(0.025, df)
tscore_95
## [1] -2.085963
CI_95 <- mean_val + c(1, -1)*tscore_95 * se
CI_95
## [1] 26.91607 37.46488

The mean amount of time (in seconds) that it took heavy smokers to fall off a treadmill at the fastest setting was 32.19 (SE = 2.53, 95% CI = 26.92 to 37.46). We are 95% confident that the true population mean falls within 26.92 and 37.46.

The 99% confidence interval

tscore_99 <- qt(0.005, df)
tscore_99
## [1] -2.84534
CI_99 <- mean_val + c(1, -1) * tscore_99 * se
CI_99
## [1] 24.99597 39.38498

The mean amount of time (in seconds) that it took heavy smokers to fall off a treadmill at the fastest setting was 32.19 (SE = 2.53, 99% CI = 25.00 to 39.38). We are 99% confident that the true population mean falls within 25.00 and 39.38.

I selected to use the t distribution because the sample size is less than 30.

2.

What are the problems with null hypothesis significance testing?

  • In statistics, we begin with the assumption that the null hypothesis is true. We assume that there is no effect, the the means are equal to each other. Then we fit an alternative model to see how well the alternative hypothesis fits. We look to see if they are different from each other. If they are truly different from each other, then the alternative model will fit well. We get a p-value. The p-value is the probability, over many many identical tests, of getting a test statistic at least as big as the one we have, if there was in fact, no effect, and all other assumption of the model were met.

  • By definition of the probability, an α-level (usually .05) means that some of the time, you will be wrong.

  • The opposite can also be true. Some times you might fail to reject a null when the alternative is actually accurate. β-level (often .2)

  • You have to decide which is the lessor of two evils.

  • p-value doesn’t tell us about the importance of an effect.

  • If you have a really big sample, you can almost always find significance.

3.

What is the Bonferroni correction and why is it used? If you do 3 tests, each at 95% probability of no type 1 error – you get: 0.95 * 0.95 * 0.95 = 0.857 Now your probability of a type 1 error = 1-0.857 = 14.3%. You increase the likelihood of making a type one error. To deal with the idea that you increase the risk of error, Bonferroni lead this movement to take alpha and divide it by how ever many test you do. For three tests with each set to 0.05, you take 0.05 / 3. This makes the p-value a much smaller number.

0.05 / 3
## [1] 0.01666667

alpha becomes 0.0167. There are alternative ways but this way is very simple.

4.

If my experimental hypothesis is: “Eating cheese before bed affects the number of nightmares you have”, what would be the null hypothesis? Is this a one-tailed or two-tailed test?

H0 = Eating cheese before bed does not affect the number of nightmares you have”

HA = Eating cheese before bed affects the number of nightmares you have”

5.

In null hypothesis significance testing, we talk of a p-value. Of what is p the probability?

The p-value is the probability, over many many identical tests, of getting a test statistic at least as big as the one we have, if there was in fact, no effect, and all other assumption of the model were met.

The p-value is the probability that the chosen test statistic would have been at least as large as its observed value if every model assumption were correct, including the test (typically null) hypothesis. Finding a small p-value doesn’t tell us which assumption is incorrect – it could be that the null hypothesis is false or it could be that the study protocols were violated or by chance we got an unusual sample