The Behavioral Risk Factor Surveillance Survey is conducted biannually. We have
ID: 3173335 • Letter: T
Question
The Behavioral Risk Factor Surveillance Survey is conducted biannually. We have the data from 1970 and 1990. The following measurements were made on each individual surveyed: weight: measured in pounds, with a value of 999 for missing height: measured in inches age: measured in years daysSick: number of days in the past 30 days that health was not good. Values include 1 to 30. "None" is coded as 88. last Checkup: time since last routine checkup. Values are 1 for within a year, 2 for more than 1 and less than 2 years, 3 for more than 2 and less than 5 years, 4 for more than 5 years, and NA for don't know. phone: the respondent was contacted by land line (1) or cell phone (2). The data are in a data frame called BRFSS. To prepare the data for analysis, write code to perform each of the following operations. Recode the "number of days sick' so that 88 is 0. Convert a weight of 999 to NA. Turn lastCheckup into a factor with appropriate labels for the levels (reminder: use factor command that requires variable name and labels as arguments). Drop all records from the data frame that have a value of NA for the time of the last check up. (Assign the smaller data frame to BRFSS2).Explanation / Answer
a) Recode the "Number of days sick" so that 88 is 0.
b) Convert a weight of 999 to NA
c) lastCheckup into a factor
d) Drop of all records that have a value of NA for the time of last check up
BRFSS2=BRFSS[complete.cases(BRFSS$lastCheckup),]
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.