assignment-2.pdf - CIND 123 Assignment#2 This is an R Markdown document Markdown is a simple formatting syntax for authoring HTML PDF and MS Word

assignment-2.pdf - CIND 123 Assignment#2 This is an R...

This preview shows page 1 - 3 out of 9 pages.

CIND 123 - Assignment #2 This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . Use RStudio for this assignment. Edit the file assignment-2.Rmd and insert your R code where wherever you see the string “INSERT YOUR ANSWER HERE” When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. When your are done with your answers and before submitting, save the file with the following naming convention: your Lastname_Firstname Submit both the rmd and the pdf output (or word or html) files, failing to submit both will be subject to mark deduction. This assignment makes use of data that is provided by the ISwR package. library (ISwR) ## Warning: package ISwR was built under R version 3.2.5 Question 1 - 35% In this question you will explore the relation between blood pressure and obesity. The data frame bp.obese measures blood pressure, obsesity, and sex on a random sample of adults. a) Print the head of bp.obese to familiarize yourself with the data. print ( head (bp.obese)) ## sex obese bp ## 1 0 1.31 130 ## 2 0 1.31 148 ## 3 0 1.19 146 ## 4 0 1.11 122 ## 5 0 1.34 140 ## 6 0 1.17 146 b) Print a summary of bp.obese . print ( summary (bp.obese)) ## sex obese bp ## Min. :0.0000 Min. :0.810 Min. : 94.0 ## 1st Qu.:0.0000 1st Qu.:1.143 1st Qu.:116.0 ## Median :1.0000 Median :1.285 Median :124.0 ## Mean :0.5686 Mean :1.313 Mean :127.0 ## 3rd Qu.:1.0000 3rd Qu.:1.430 3rd Qu.:137.5 ## Max. :1.0000 Max. :2.390 Max. :208.0 1
Image of page 1
Note that sex is a numeric vector but it should be a factor.
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 9 pages?

  • Summer '18

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes