An archive the questions from Mark's Summer 2018 Stat 185.

Comparing Peachtree times across age groups

mark

(10 pts)

In this assignment, you’ll examine the degree to which runners slow down with age in much the same way that we did in our class notes. You’ll begin by grabbing our data from the 2015 Peachtree Road Race and then separating out some younger and older runners as follows:

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)

Note that the group of young riders and the group of old riders are still quite large - well over 5000 each. Your mission is to grab a random sample like so:

set.seed(n)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)

Note that n here is an integer. You should choose your value of n by finding your position in our Groovy Class Randomizer.

Once you have your samples, run t.test to compare the means, as we did in our class notes. Be sure to clearly state the conclusion at the end!

mark
mark
jthomps6

H_0: mu_y < mu_o
H_A: mu_y > mu_o

R-Studio Code

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)

set.seed(6)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)

mu_young = mean(young_times)
mu_old = mean(old_times)
c(mu_young, mu_old)

Means of Young Times and Old Times Respectively.
75.67018, 74.15254

The means of the young times were larger than the old times.

t.test(x = young_times, y = old_times, alternative = "greater")

                      Welch Two Sample t-test

data:  young_times and old_times
t = 0.45779, df = 197.19, p-value = 0.3238
alternative hypothesis: true difference in means 
is greater than 0
90 percent confidence interval:
 -2.745148       Inf
sample estimates: mean of x mean of y 
75.67018  74.15254 

The data provided of the random sample of 100 people was not significant enough to reject the null hypothesis (p-value = 0.3238, 90% confidence interval).

philycheesestk

H0: μy = μo
HA: μy < μo

Here are the results of my t.test on the Peachtree race times:

t.test(young_times, old_times, alternative = "less")

    Welch Two Sample t-test

data:  young_times and old_times
t = -1.3342, df = 192.26, p-value = 0.09185
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
  -Inf 0.9396174
sample estimates:
mean of x mean of y 
70.97796  74.91299 

Conclusions:

Looking at the two sample means that have been calculated from running this test, I would conclude that the younger runners on average, have faster race times. The older runners have slower times, which is not very shocking to me.

At a 90% confidence internal I was able to reject the null, p-value = 0.09185 at a 90% confidence interval.

robin

Code Used

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(14)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
 t.test(x = young_times, y = old_times, alternative = "greater")

Output

Welch Two Sample t-test

data:  young_times and old_times
t = 0.26775, df = 197.62, p-value = 0.3946
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
 -3.50758      Inf
sample estimates:
mean of x mean of y 
71.59364  70.91549 

Conclusion
Based on my sample, there is no difference between running times of older vs younger runners. The two means are less than 1 minute apart and the p-value is 0.3946.

AlexisBrandt

H_0: mu_y = mu_0
H_A: mu_y < mu_0

My random sample:

set.seed(1)



c(mu_young,mu_old)
[1] 71.10883 74.21850

T-Test:

t.test(young_times, old_times, alternatives = "less")

Welch Two Sample t-test

data:  young_times and old_times
t = -1.2026, df = 190.64, p-value = 0.2306
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-8.210024  1.990684
sample estimates:
mean of x mean of y 
 71.10883  74.21850 

With a p-value of .2306, fail to reject the null.

albeatty

hypotheses

H_0: young_times < old_times
H_A: old_times > young_times

R code

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(2)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
t.test(young_times, old_times,alternative = "greater")

Welch Two Sample t-test

data:  young_times and old_times
t = -0.57489, df = 196.92, p-value = 0.717
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
 -6.90324      Inf
sample estimates:
mean of x mean of y 
 71.78470  73.56633 

conclusion

fail to reject null hypothesis as the p-value is only 0.717…younger runners are, on average, faster!

Lumpyhead00
df = 
read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(12)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
t.test(young_times, old_times, alternative = "less")

Welch Two Sample t-test

data:  young_times and old_times
t = -1.9042, df = 195.56, p-value = 0.02918
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
   -Inf -0.6829458
sample estimates:
mean of x mean of y 
69.82400  74.99434 

I would reject the null hypothesis given a p=0.02918, and a 90% Confidence Level

jmahan

Hypothesis Test
H_0:μ_y=μ_o
H_A;μ_y<μ_o

Below is the code I used to generate my t.test

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(11)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
t.test(old_times,young_times,alternative = "greater")

Which generated this output:

Welch Two Sample t-test

data:  old_times and young_times
t = 3.223, df = 187.22, p-value = 0.0007483
alternative hypothesis: true difference in means is greater than 0
95 percent confidence interval:
3.726924      Inf
sample estimates:
mean of x mean of y 
72.61854  64.96749 

Conclusion:

Looking at the means associated with the average old and new runner times it seems that on average older runners have slower times than younger runners.

Given a 90% confidence interval:

0.0007483<0.10 so we reject the null hypothesis that the old and new runners on average have the same times.

ktaylor4

Test
H_O: u_y = u_o
H_A: u_y < u_o

Input: 
 df=read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
  young=subset(df,25<=Age&Age<30)
  old=subset(df,35<=Age&Age<40)
  set.seed(8)
  young_times=sample(young$Net.Time,100)
  old_times=sample(old$Net.Time,100)
  t.test(young_times,old_times,alternative = "less")
Output
Welch Two Sample t-test
data:  young_times and old_times
t = -1.3342, df = 192.26, p-value = 0.09185
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
  -Inf 0.9396174
sample estimates:
mean of x mean of y 
 70.97796  74.91299

Conclusion
The younger runners in my test indeed ran faster than the older runners. The p-value of 0.09185 is less than 0.1. I reject the null hypothesis.

KBC2019
df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)

old = subset(df, 35<=Age & Age<40)
set.seed(7)

c(mu_young,mu_old)
[1] 75.67018 74.15254

t.test(young_times, old_times, alternatives = "less")

Welch Two Sample t-test

data:  young_times and old_times
t = 0.45779, df = 197.19, p-value = 0.6476
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -5.020013  8.055293
sample estimates:
mean of x mean of y 
 75.67018  74.15254 

You would fail to reject the null hypothesis as the p value is greater than 0.1.

jgilfill
df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)

set.seed(4)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)

H0:μy=μo
HA: μy<μo

t.test(x = young_times, y = old_times, alternative = “less”)

Welch Two Sample t-test

 data:  young_times and old_times
 t = 0.64069,            df = 198,           p-value = 0.7388
 alternative hypothesis: true difference in means is less than 095 percent 
 confidence interval: -Inf 6.709997
 sample estimates:
 mean of x   mean of y 
 74.43734    72.56271 

The provided random sample of 100 people was significant enough to fail to reject the null hypothesis (p-value = 0.7388, 95% confidence interval)

Henry

H_0: μ_y = μ_o
H_A: μ_y < μ_o

code:

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(3)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
mu_young = mean(young_times)
mu_old = mean(old_times)
c(mu_young,mu_old)
[1] 71.75546 74.05197

t.test(young_times,old_times,alternative ="less")

Welch Two Sample t-test

data:  young_times and old_times .
t = -0.76131, df = 197.77, p-value = 0.2237
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
    -Inf 2.688587
sample estimates:
mean of x mean of y 
 71.75546  74.05197 

From the sample taken, younger runners on average finshed the race with lower times than others in older age groups. However, I failed the reject the null hypothesis at a 90% confidence level after calculating a p-vlaue of 0.2237.

KBiehler1

H_0:mu_y =mu_o
H_A:mu_y<mu_o

Input

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)
set.seed(9)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
t.test(young_times, old_times, alternative = "less")

Output

Welch Two Sample t-test

data:  young_times and old_times
t = -0.76131, df = 197.77, p-value = 0.2237
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
-Inf 2.688587
sample estimates:
mean of x mean of y 
71.75546  74.05197 

Conclusion

Based on the t-test results, the younger runners had faster race times with a mean time of 71.75546 while the mean time of the older runners is 74.05197. At a 95% confidence interval, the calculated p-value is 0.2237. We would reject the null hypothesis.

mdavis9
set.seed(11)

young_times = sample(young$Net.Time, 100)

old_times = sample(old$Net.Time, 100)

mu_young = mean(young_times)

mu_old = mean(old_times)

c(mu_young, mu_old)

New mean vs. Old mean
[1] 64.96749 72.61854

Welch Two Sample t-test

data:  young_times and old_times
t = -3.223, df = 187.22, p-value = 0.9993
alternative hypothesis: true difference in means is 
greater than 0
95 percent confidence interval:
 -11.57518       Inf
sample estimates:
mean of x mean of y 
 64.96749  72.61854 
With the P-Value of 0.9993 i will fail to reject.
mmealie

H_0: \mu_1 = \mu_2
H_A: \mu_1 < \mu_2

df = read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)

set.seed(13)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)

Welch Two Sample t-test

data:  young_times and old_times
t = -1.1418, df = 194.33, p-value = 0.1275
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
 -Inf 1.480773
sample estimates:
mean of x mean of y 
70.71965  74.02852 

Analyzing the two sample means from running the two sample t test leads to the conclusion that there is not a significant difference between the average times between young runners and older runners. (p-value 0.1275)

Lumpyhead00
 df = 
read.csv('https://www.marksmath.org/data/peach_tree2015.csv')
young = subset(df, 25<=Age & Age<30)
old = subset(df, 35<=Age & Age<40)

set.seed(12)
young_times = sample(young$Net.Time, 100)
old_times = sample(old$Net.Time, 100)
mu_young = mean(young_times) 
mu_old = mean(old_times) 
c(mu_young, mu_old)

The Mean of young and old times
69.82400 74.99434

The mean of the young times were lower than the old times