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

# Examining some random heights

mark

(5pts)

For this problem, we’re going to import the same random CDC-like data set that we imported before but, this time, we’ll investigate the heights of the people in the sample. Specifically,

• Compute the mean and standard deviation of your data
• Plot the histogram of your data

We’ll work on this together on Friday, September 8 and we’ll have an in class lab to help us learn these basics.

Also, please do make sure to indent your computer code 4 spaces so that it is typeset as computer code. For example, when I want my input to look like this:

mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=mark')
heights = mydf$height  I have to actually type this:  mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=mark') heights = mydf$height
blaiser1
cdc = read.csv("https://marksmath.org/data/cdc.csv")
heights=subset(cdc, gender == 'f')$height qqnorm(heights) m = mean(heights) s = sd(heights) c(m,s)  like this? TineriTalentati mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=TineriTalentati') > heights=mydf$height
> mean(heights)
[1] 66.952
> sd(heights)
[1] 3.831491
> plot(heights)
> plot(table(heights))
> plot(hist(heights))


Dancerlikens

emeli
> mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=emeli')
> heights = mydf$height > mean (heights) [1] 66.3462 > plot (heights) > plot (table:heights) > plot (table(heights)) > plot (hist(heights)) > sd (heights) [1] 4.053651 > mean (heights) [1] 66.3462  LunaLovegood > mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=LunaLovegood') > heights = mydf$height
> mean(heights)
[1] 65.4689
> sd(heights)
[1] 3.761871
> plot(hist(heights))


mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=Erad')
heights = mydf$height heights [1] 62.07 64.47 60.93 70.72 64.72 61.75 71.08 73.80 65.26 [10] 64.31 66.97 61.89 60.47 68.89 64.07 70.34 68.98 67.96 [19] 66.56 66.57 72.18 64.37 70.43 71.43 59.17 61.43 66.53 [28] 67.72 67.34 63.07 62.43 66.36 62.17 64.64 65.25 64.09 [37] 66.04 62.65 65.91 61.79 73.54 70.01 69.00 69.03 69.24 [46] 66.86 65.75 66.57 63.97 70.61 71.58 73.27 62.96 62.40 [55] 65.14 68.16 64.58 72.59 67.08 62.15 65.72 64.78 71.24 [64] 60.79 68.19 64.96 62.56 74.11 67.00 62.12 68.22 60.08 [73] 65.42 68.15 63.01 60.64 63.26 68.10 64.61 66.55 65.57 [82] 60.70 69.31 68.07 67.23 65.14 61.96 65.24 76.02 63.22 [91] 64.49 63.62 63.04 60.07 63.60 64.37 69.79 68.20 64.24 [100] 63.94 mean (heights) [1] 65.9863 sd(heights) [1] 3.641917 hist(heights)  oyang mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=oyang') heights = mydf$height
mean (heights)
[1] 66.0349
plot (heights)
plot (table(heights))
plot (hist(heights))
sd (heights)
[1] 3.887274
mean (heights)
[1] 66.0349


lilyz
> f = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=lilyz')
> heights = mydf$height > mean(heights) [1] 66.8293 > plot(heights) > plot(hist(heights))  vee  mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=vee') > heights = mydf$height
>
> mean(heights)
[1] 66.2715
> sd(heights)
[1] 3.50176
> plot(heights)
> plot(hist(heights))
>


everyrose
mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=everyrose')
heights = mydf$height mean(heights) [1] 66.6915 sd(heights) 4.021299 plot (heights) plot (table(heights)) plot(hist(heights))  ceciliastack21 TaylorHinson > mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=TaylorHinson') > mean(heights) [1] 66.2947 > sd(heights) [1] 3.970364 >plot(hist(heights))  sunflower mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=mark') heights = mydf$height> mean(heights)
[1] 66.8332
sd(heights)
[1] 3.550039


plot(hist(heights))

shiller
mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=shiller')
first_name last_name age gender height weight income smoke100 exerany
#1   Cornelia     Heath  59 female  66.51 171.07   1317        0       1
#2  Christine      Reid  33 female  63.91 188.63   5064        1       1

height=mydf$height mean(height) [1] 66.7075 sd(height) [1] 3.973815 plot(height) plot(table(height)) plot(hist(height))  shiller Hi everyone, especially @mark I am confused with how to import a picture of my histogram from R into discourse. When I type the above code into R, a lovely histogram appears but nothing happens when I type it into discourse. I tried copy and pasting/ saving and importing the image of the histogram but to no avail. How’d y’all do it so nicely?!? shiller Just kidding I finally figured it out~ for anyone else who’s wondering you right click the histogram, “copy a bitmap” and paste that into discourse. I yi yi! Coolcatcullen mydf = read.csv(‘https://marksmath.org/cgi-bin/random_data.csv?username=Coolcatcullen’) heights = mydf$height


mean(heights)
[1] 66.0093
sd(heights)
[1] 3.671795
plot(hist(heights))

scrouse

heights=mydf$height mean(heights) [1] 65.9302 sd(heights) [1] 3.897156 Histogram of heights swtaylor mydf = read.csv('https://marksmath.org/cgi-bin/random_data.csv?username=swtaylor') heights = mydf$height
m = mean(heights)
s = sd(heights)
c(m,s)
[1] 66.161000  3.934704


For a scatter-plot representation:

qqnorm(heights)


For some reason I can’t get a Histogram to pull up, it keeps giving me error messages.