STAT 1031 Biostatistics HW5 QUESTIONS WITH VERIFIED ANSWERS
41 views 0 purchase
Course
STAT 1031
Institution
University Of Cincinnati
20 BME 3060: Introduction to Biostatistics
Homework #5
Download the data ‘studentdata’ from the package ‘LearnBayes.’
1. Create a separate column labelled as ‘HoursSlept’ in the ‘studentdata’ folder recording
how many hours each student slept the previous night. Obtain summary s...
20 BME 3060: Introduction to Biostatistics
Homework #5
Download the data ‘studentdata’ from the package ‘LearnBayes.’
1. Create a separate column labelled as ‘HoursSlept’ in the ‘studentdata’ folder recording
how many hours each student slept the previous night. Obtain summary statistics of all
data in the enhanced ‘studentdata.’ 3 points
Code:
library(LearnBayes)
data("studentdata")
studentdata$HoursSlept= (studentdata$WakeUp- studentdata$ToSleep)
dim(studentdata)
head(studentdata)
m
er as
summary(studentdata)
co
eH w
Summary statistics:
o.
Student Height
rs e
Gender Shoes
ou urc
Min. : 1 Min. :54.0 female:435 Min. : 0.00
1st Qu.:165 1st Qu.:64.0 male :222 1st Qu.: 6.00
Median :329 Median :66.0 Median : 12.00
Mean :329 Mean :66.7 Mean : 15.42
o
3rd Qu.:493 3rd Qu.:70.0 3rd Qu.: 20.00
Max. :657 Max. :84.0 Max. :164.00
aC s
NA's :10 NA's :22
vi y re
Number Dvds ToSleep WakeUp
Min. : 1.00 Min. : 0.00 Min. :-2.500 Min. : 1.000
1st Qu.: 4.00 1st Qu.: 10.00 1st Qu.: 0.000 1st Qu.: 7.500
Median : 6.00 Median : 20.00 Median : 1.000 Median : 8.500
ed d
Mean : 5.67 Mean : 30.93 Mean : 1.001 Mean : 8.383
ar stu
2. Obtain summary statistics of ‘Height’ for males. 2 points
Code:
males_data= subset(studentdata, studentdata$Gender=="male") #separate male data from
female
summary(males_data$Height)
Summary statistics of height for males
3. Obtain standard deviation of ‘Height’ for males. 1 point
m
er as
Code: sd(males_data$Height, na.rm = T)
co
Standard deviation of ‘Height’ for males: 3.080943 (units)
eH w
o.
4. Obtain summary statistics of ‘Height’ for females. 2 points
rs e
Code: females_data= subset(studentdata, studentdata$Gender=="female")Summary
ou urc
statistics of ‘Height’ for females:
o
aC s
vi y re
5. Obtain standard deviation of ‘Height’ for females. 1 point
Code: sd(females_data$Height, na.rm = T)
ed d
Standard deviation of ‘Height’ for females: 3.363986
ar stu
6. Portray the (density) histograms of heights for males and females in the same frame.
Superimpose each histogram with nonparametric density curve and appropriate normal
is
curve. Include the rugs. 6+4+4+2 points
Th
Code:
par(mfrow= c(1,2), oma= c(5, 4, 4, 2))
hist(males_data$Height, xlab= "Height of Males",
sh
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Themanehoppe. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.49. You're not tied to anything after your purchase.