An archive of Mark's Fall 2017 Intro Stat course.

Find a confidence interval for just a few random heights for 11:00 AM

mark

(5 pts)

By now, we’ve played with random data quite a few times. We’re going
to do so again but, this time, we’re not going to import quite so much
data - only 12 rows. I can do this like so:

df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=mark&length=12')
dim(d)

# Out: 12 10

That output indicates that I’ve got only twelve rows of data.

Your assignment: Perform a t.test on the column of heights and
report your confidence interval. As always, your code should be
typeset as code and your answer should be typeset as prose.

brifro

T-Test of my Data:

 df = read.csv(‘https://www.marksmath.org/cgi-bin/random_data.csv?username=brifro&length=12’)
View(df)
data.height

df$height
[1] 70.04 62.41 58.34 60.06 65.26 68.59 64.04 60.72 62.76 69.36 63.17 67.40
 height = c(62.41, 58.32, 60.06, 65.26, 68.59, 64.04, 60.72, 62.76, 69.36, 63.17, 67.40)
 t.test(height, conf.level = 0.95)

One Sample t-test:

data:  height
t = 59.657, df = 10, p-value = 4.255e-14
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 61.44249 66.21024
 sample estimates:
 mean of x 
 63.82636 

My 95% confidence interval according to my t-test is: approximately: [61.44249, 66.21024]

shiller
df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=shiller&length=12')
df$height
   [1] 66.51 64.74 66.20 70.88 62.36 67.63 65.84 66.72 65.87 61.69 69.80 69.69
 t.test(df$height,conf.level = .95)

One Sample t-test

data:  df$height
t = 82.442, df = 11, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 64.71894 68.26939
sample estimates:
mean of x 
 66.49417 

My 95% confidence interval is [64.71894, 68.26939]

Megatog
df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Megatog&length=12')
df$height
[1] 70.33 70.85 71.70 66.14 66.60 59.84 73.20 66.54 67.93 60.75 68.08 60.04
height = c(70.33, 70.85, 71.70, 66.14, 66.60, 59.84, 73.20, 66.54, 67.93, 60.75, 68.08, 60.04)
t.test(height, conf.level = 0.95)

One Sample t-test

data:  height
t = 50.85, df = 11, p-value = 2.092e-14
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
63.94054 69.72612
sample estimates:
mean of x 
66.83333 

According to my code, my 95% confidence interval is [63.94054, 69.72612].

emeli
 read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=mark&length=12')
 first_name  last_name age gender height weight income
1       Donna      Dinan  35 female  65.37 164.26   1947
2       Ramon      Davis  20   male  66.59 139.53  22747
3        Mark       Buss  23   male  74.58 124.21  15489
4       Lidia     Elmore  52 female  63.87 153.64   8369
5        Nina Mcilhinney  40 female  61.33 118.81   3452
6     Phyllis     Curtis  34 female  64.03 154.81   1149
7      Harold      Lyons  52   male  70.98 199.52  10101
8   Francisco       Lowe  36   male  68.09 171.67    122
9     Antonio Stockstill  40   male  67.65 137.28  14452
10     Esther    Newkirk  42 female  60.96 153.37   3001
11     Walter      Serna  44   male  68.11 220.62   2427
12      Donna     Castro  36 female  63.38 106.92  15050
smoke100 exerany handedness
1         N       Y          R
2         Y       Y          R
3         N       Y          R
4         N       Y          R
5         N       Y          R
6         Y       Y          R
7         N       Y          R
8         N       Y          R
9         N       N          R
10        N       Y          R
11        Y       N          L
12        N       Y          R

t.test(df$height)
One Sample t-test

data:  df$height
t = 58.404, df = 11, p-value = 4.582e-15
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
63.02438 67.96062
sample estimates:
mean of x 
65.4925 

Confidence interval [63.02438, 6796062]

TaylorHinson
df=read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=TaylorHinson&length=12')

df$height
[1] 60.96 62.50 66.41 72.21 66.36 71.97 61.17 61.61 61.21 72.95 70.05 67.72

t.test(df$height)

  data:  df$height
t = 48.68, df = 11, p-value = 3.372e-14
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
63.26418 69.25582
sample estimates:
mean of x 
66.26 

The 95% confidence Interval is [63.26418, 69.25582]

LunaLovegood

I used R to perform a t-test of my data.

 df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=LunaLovegood&length=12')
 # Out: 12 10
 View(df)
 df$height
 [1] 63.54 68.56 71.30 68.90 70.13 69.33 65.86 62.01 68.75
[10] 66.37 71.86 62.30
 t.test(df$height, conf.level = 0.95)

One Sample t-test

data:  df$height
t = 69.246, df = 11, p-value = 7.074e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 65.26656 69.55177
sample estimates:
mean of x 
 67.40917 

As shown in the code, the 95% confidence interval is [65.26656, 69.55177]

ceciliastack21

df = read.csv(‘https://www.marksmath.org/cgi-bin/random_data.csv?username=ceciliastack21&length=12’)

df height [1] 65.56 69.08 61.69 73.41 71.06 70.39 64.71 63.85 69.90 74.03 66.04 68.20 t.test(df height)

One Sample t-test

data: df$height
t = 61.361, df = 11, p-value = 2.666e-15
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
65.71515 70.60485
sample estimates:
mean of x
68.16






My 95% Confidence interval is [65.71515, 70.60485]

TineriTalentati
df = read.csv('https://www.marksmath.org/cgi-
bin/random_data.csv?
username=TineriTalentati&length=12')

df$height
[1] 65.29 65.92 68.00 65.71 63.13 64.97 66.01
[8] 71.29 69.46 74.12 70.51 67.37
d= c(65.29, 65.92, 68.00, 65.71, 63.13, 64.97, 66.01, 
71.29, 69.46, 74.12, 70.51, 67.37)

t.test(d, conf.level = 0.95)

One Sample t-test

data:  d
t = 74.309, df = 11, p-value = 3.26e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
65.64465 69.65202
sample estimates:
mean of x 
67.64833 

According to my t.test, my 95% confidence interval is
[65.64465, 69.65202].

everyrose

I start by pulling data using R, and focusing on the first 12 values in the height column.

df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=everyrose&length=12')
dim(df)
[1] 12 10
df$height
[1] 66.20 68.34 67.91 64.24 69.57 71.67 70.24 66.91 58.83 65.63 62.01 70.84
height = c(66.20, 68.34, 67.91, 64.24, 69.57, 71.67, 70.24, 66.91, 58.83, 65.63, 62.01, 70.84)
t.test(height, conf.level=0.95)

T-Test Results:

    One Sample t-test
data:  height
t = 61.145, df = 11, p-value = 2.771e-15
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
64.45892 69.27275
sample estimates:
mean of x 
66.86583 

According to the T-Test, my 95% confidence interval is approximately [64.45892, 69.27275].

Elena
One Sample t-test
T-test of data 
df = read.csv('http://www.marksmath.org/cgi-bin/random_data.csv?username=Elena&length=12')
df$height
[1] 69.93 71.61 62.95 63.55 70.88 67.97 70.67 65.66 69.36 65.09 61.87 71.22

data:  df$height
t = 167.76, df = 99, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 66.253 67.839
sample estimates:
mean of x 
   67.046 

my 95% confidence Interval according to my t-test is [66.253,67.839]
laurabeth
> df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=laurabeth&length=12')
> df$height
 [1] 61.55 71.23 64.51 61.72 66.74 69.20 71.51 66.43 72.84
[10] 65.64 66.19 66.78
> height=c(61.55, 71.23, 64.51, 61.72, 66.74, 69.20, 71.51, 66.43, 72.84, 65.64, 66.19, 66.78)   
> t.test(height, conf.level = 0.95)

One Sample t-test
data:  height
t = 64.198, df = 11, p-value = 1.623e-15 
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
64.73031 69.32636
sample estimates:
mean of x: 
67.02833 

My 95% confidence interval is : [64.73031, 69.32636]

oyang

T-Test of my Data:

df = read.csv('https://www.marksmath.org/cgi- bin/random_data.csv?username=oyang&length=12')
 
df$height
 [1] 62.62 65.00 70.25 64.87 64.42 64.11 64.87 68.33
 [9] 64.65 63.77 63.58 64.70

One Sample t-test

t.test(df$height)

data:  df$height
t = 106.73, df = 11, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:  63.75505 66.43995
sample estimates:
mean of x 
65.0975 

My 95% confidence interval according to my t-test is approximately [63.75505, 66.43995]

emma0126

T-Test of my data:

df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv
username=emma0126&length=12')
View(df)
df$height
[1] 71.83 67.39 69.44 65.96 62.63 60.08 69.15 61.98 68.77 70.16 63.60 67.72
height = c(67.39, 69.44, 65.96, 62.63, 60.08, 69.15, 61.98, 68.77, 70.16, 63.60, 
67.72)
t.test(height, conf.level = 0.95)

One Sample t-test

data:  height
t = 63.298, df = 10, p-value = 2.356e-14
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
63.75395 68.40605
sample estimates:
mean of x 
66.08 

My 95% confidence level according to my t-test is approximately: [63.75395, 68.40605]

vee

First, copy and past that code, but make sure to change your username.

> df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?
username=vee&length=12')
> dim(df)
[1] 12 10
df$height
[1] 71.61 66.86 71.35 68.63 67.97 67.77 68.43 69.55 70.41
[10] 65.43 74.05 67.72

Now run your t.test

> t.test(df$height,  conf.level = 0.95)

One Sample t-test

data:  df$height
t = 101.01, df = 11, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 67.64158 70.65509
sample estimates:
mean of x 
69.14833

So, my confidence interval is, 67.64158 70.65509.

Nashman92

This is a T-Test of my data.
This is the data that was used.

df= read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Nashman92&length=12')
df$height
[1] 69.06 70.02 67.26 61.93 61.18 64.76 59.70 64.40 66.14 63.01 70.91 66.28

And here is the actual test and the results of the test.

    t.test(df$height, conf.level = 0.95)

    One Sample t-test
  data:  df$height
  t = 63.642, df = 11, p-value = 1.786e-15
  alternative hypothesis: true mean is not equal to 0
  95 percent confidence interval:
  63.12614 67.64886
  sample estimates:
  mean of x 
  65.3875 

My 95% confidence interval is [63.12614, 67.64886].

Chase
  df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=Chase&length=12')

  df$height
 [1] 64.14 65.20 65.26 56.65 70.04 75.09 62.66 61.40 61.13 70.26 73.46 69.61

  t.test(df$height)

    One Sample t-test

data:  df$height
t = 41.694, df = 11, p-value = 1.838e-13
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
62.74486 69.73847
sample estimates:
mean of x 
66.24167 

My 95% confidence interval is [62.74486, 69.73847]

Dancerlikens
df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?username=mlikens&length=12')

df$height

[1] 66.51 64.74 66.20 70.88 62.36 67.63 65.84
[8] 66.72 65.87 61.69 69.80 69.69

mean(df$height)

[1] 66.49417

One Sample t-test

data:  df$height
t = -4.1328e-06, df = 11, p-value = 1
alternative hypothesis: true mean is not equal to 66.49417
95 percent confidence interval:
64.71894 68.26939
sample estimates:
mean of x 
66.49417

The 95% confidence interval for this data is:
[64.71894, 68.26939]

Erad
df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?
username=Erad&length=12')
df$height
[1] 62.07 65.59 63.22 63.23 64.87 65.75 73.80 62.51 69.93 68.49 63.51 69.42
df
first_name   last_name age gender height weight income smoke100 exerany handedness
1      Lashawn       Parks  39 female  62.07 177.27   6312        Y       Y          R
2        Clara     Landers  57 female  65.59 173.18   4364        N       N          R
3          Iva      Spears  32 female  63.22 171.55   4309        N       Y          R
4   Marguerite       Geise  57 female  63.23 173.17   4692        N       Y          R
5      Bernice      Willis  33 female  64.87 198.35  21841        N       N          L
6         Ruby      Miguel  38 female  65.75 206.60 240986        N       Y          R
7  Christopher      Duncan  44   male  73.80 127.45  53690        Y       Y          R
8        Amber        Geno  37 female  62.51 128.01   2252        N       N          R
9        Sammy Hertenstein  32   male  69.93 159.07     71        Y       Y          R
10       Devin       Mucci  36   male  68.49 148.74  90378        N       Y          R
11        June        Fuhr  23 female  63.51  84.43   8636        N       Y          R
12       Kevin     Rappold  25   male  69.42 213.33   2246        Y       Y          L
t.test(df$height)

One Sample t-test

data:  df$height
t = 63.024, df = 11, p-value = 1.988e-15
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
  63.72645 68.33855
sample estimates:
mean of x 
  66.0325 

My 95 percent confidence interval is (63.72645, 68.33855)

avocadoburrito
df = read.csv('https://www.marksmath.org/cgi-bin/random_data.csv?
username=avocadoburrito&length=12')
df$height
[1] 72.02 63.39 59.91 68.15 61.87 73.16 66.37 67.97 65.46
[10] 65.13 74.63 63.32
 t.test(df$height,conf.level = .95)

One Sample t-test

data:  df$height
t = 50.321, df = 11, p-value = 2.345e-14
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
63.86073 69.70260
sample estimates:
mean of x 
66.78167 

My confidence level based is [63.86073,69.70260]