Question: 1. Import the homework data excel file into R. 2. Create a new variable 'obese' that distinguishes those with a BMI of 29 or lower
1. Import the homework data excel file into R.
2. Create a new variable 'obese' that distinguishes those with a BMI of 29 or lower from those with a BMI of 30 or higher.
3. Create a new categorical variable that distinguishes between those who live in Boston and those who live in any other city. This would mean that the variable is dichotomous Boston/all other cities.
4. Upload the code that you used to do these transformations in a text file
| id | bmi | city | gender |
| 1 | 34 | boston | m |
| 2 | 40 | boston | m |
| 3 | 31 | boston | f |
| 4 | 25 | boston | f |
| 5 | 32 | lynn | f |
| 6 | 37 | lowell | f |
| 7 | 37 | lowell | m |
| 8 | 28 | worcester | m |
| 9 | 28 | boston | m |
| 10 | 39 | lowell | m |
| 11 | 37 | worcester | m |
| 12 | 39 | boston | f |
| 13 | 23 | lowell | f |
| 14 | 26 | boston | f |
| 15 | 33 | boston | m |
| 16 | 28 | lynn | m |
| 17 | 28 | lowell | m |
| 18 | 27 | lowell | m |
| 19 | 33 | worcester | f |
| 20 | 22 | boston | m |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
