Question
For each of the following case, describe the best possible data structure (e.g., array, data frame, list, table etc.) for representing the data. Also, write
For each of the following case, describe the best possible data structure (e.g., array, data frame, list, table etc.) for representing the data. Also, write appropriate R codes to answer the questions that follow, treating the data as if it is given.
(a) Data:Astudyofhealtheffectsofairqualityin10majorcitiesoftheworldinvolves daily measurements on the four variables: average temperature (temp), total pre- cipitation (precip), maximum PM10 concentration (PM10) and number of deaths among elderly population (death). Measurements are available for five years.
- (i)What is the average number of deaths for each of the cities on days where the PM10 concentration is greater than 20 ?
- (ii)What is the average PM10 concentration for each of the cities on days with no precipitation and average temperature above 80 degrees F ?
(b) Data: The data consist of records of patients visit to a clinic. The measurements for each patient are: date of visit (visit), age of patient in years (age), gender with values M or F (gender), weight in lb (weight), systolic blood pressure (BP.sys), diastolic blood pressure (BP.dia), blood glucose level in mg/dl (glucose). For blood pressure levels, the unit is standard and the value is numeric with range between 0 and 600.
- (i)How many times did each patient visit the clinic ?
- (ii)What is the average systolic blood pressure level for each of the patients with maximum weight (during the study period) greater than 180 lb ?
- (iii)What is the average blood glucose level for each of the patients with age at least 40 years at the first visit ?
- 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started