Question: 1. ISWR package includes data set named bp.obese. First install SWR package and load the ISWR package. There are total 102 observations. It contains data

 1. ISWR package includes data set named bp.obese. First install SWR

package and load the ISWR package. There are total 102 observations. It

1. ISWR package includes data set named bp.obese. First install SWR package and load the ISWR package. There are total 102 observations. It contains data from a random sample of Mexican-American adults in a small California town. Type attach(bp.obese) to directly use below variables. sex; 0: male, 1: female obese; ratio of actual weight to ideal weight bp; blood pressure a) Use subset() function to select adults whose blood pressure (bp) is greater than or equal to 160. b) Use subset() function to select female adults whose blood pressure is less than 100. c) Use transform() function to create data frame named new.df with new variable obese.percent. To calculate obese.percent, multiply 100 to obese (No need to copy R output for this problem). d) Use plot() to draw a scatter plot with obese on the x-axis and bp on the y-axis. Also, change the title of x-axis to "Obese Ratio" and y-axis to Blood Pressure". (Copy both your R code and Plot to the answer.) e) Use abline() to add horizontal line to the plot to mark blood pressure 120. (Copy both your R code and Plot to the answer.) 2. Download "hitters.txt" file from Elearning and save to your R working directory folder. The data set contains 322 observations of major league players. a) Import the "hitters.txt" file to R and assign the result to hitters. 2. Download "hitters.txt file from Elearning and save to your working directory folder. The data set contains 322 observations of major league players. a) Import the "hitters.txt" file to R and assign the result to hitters. b) How many variables are in the hitters data set? c) Use subset() function to select observations with HmRun greater than or equal to 30 and assign the result with name power.hitters (No need to copy R output for this problem). d) Export power.hitters object to a text file with whatever name you like. You also need to submit this text file to dropbox in Elearning

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!