100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
STAT 1031 Biostatistics HW5 QUESTIONS WITH VERIFIED ANSWERS $11.49   Add to cart

Exam (elaborations)

STAT 1031 Biostatistics HW5 QUESTIONS WITH VERIFIED ANSWERS

 41 views  0 purchase
  • Course
  • Institution

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...

[Show more]

Preview 2 out of 5  pages

  • June 21, 2021
  • 5
  • 2020/2021
  • Exam (elaborations)
  • Questions & answers
avatar-seller
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




3rd Qu.: 7.00 3rd Qu.: 30.00 3rd Qu.: 2.000 3rd Qu.: 9.000
Max. :10.00 Max. :1000.00 Max. : 6.000 Max. :13.000
NA's :2 NA's :16 NA's :3 NA's :2
Haircut Job Drink HoursSlept
is




Min. : 0.00 Min. : 0.00 milk :113 Min. : 2.500
1st Qu.: 10.00 1st Qu.: 0.00 pop :178 1st Qu.: 6.500
Th




Median : 16.00 Median :10.50 water:355 Median : 7.500
Mean : 25.91 Mean :11.45 NA's : 11 Mean : 7.385
3rd Qu.: 30.00 3rd Qu.:17.50 3rd Qu.: 8.500
Max. :180.00 Max. :80.00 Max. :12.500
NA's :20 NA's :32 NA's :4
sh




This study source was downloaded by 100000784424693 from CourseHero.com on 06-20-2021 21:46:31 GMT -05:00


https://www.coursehero.com/file/80103099/Biostatistics-HW5docx/

, Segregate the ‘studentdata’ by gender.

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




ylab= "Density", density= 15, freq=F, col= "black",
main= "Density Histogram + Nonparametric Curve+ Normal Curve")

lines(density(x= males_data$Height, na.rm = T), col= "blue", lwd=2)
curve(dnorm(x, mean= 70.51, sd= 3.080943 ), col= "red", lwd= 2, add=T)


This study source was downloaded by 100000784424693 from CourseHero.com on 06-20-2021 21:46:31 GMT -05:00


https://www.coursehero.com/file/80103099/Biostatistics-HW5docx/

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

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

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

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.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75323 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$11.49
  • (0)
  Add to cart