Load packages
Load data
Part 1: About the Data
The Behavioral Risk Factor Surveillance System (BRFSS) is an annual telephone survey in the United States. The BRFSS is designed to identify risk factors in the adult population and report emerging trends. For example, respondents are asked about their diet and weekly physical activity, their HIV/AIDS status, possible tobacco use, immunization, health status, healthy days - health-related quality of life, health care access, inadequate sleep, hypertension awareness, cholesterol awareness, chronic health conditions, alcohol consumption, fruits and vegetables consumption, arthritis burden, and seatbelt use.
Data Collection:
Data collection procedure is explained in brfss_codebook. The data were collected from United States’ all 50 states, the District of Columbia, Puerto Rico, Guam and American Samoa, Federated States of Micronesia, and Palau, by conducting both landline telephone and cellular telephone-based surveys. Disproportionate stratified sampling (DSS) has been used for the landline sample and the cellular telephone respondents are randomly selected with each having equal probability of selection. The dataset we are working on contains 330 variables for a total of 491, 775 observations in 2013. The missing values denoted by “NA”.
Generalizability:
The sample data should allow us to generalize to the population of interest. It is a survey of 491,775 U.S. adults aged 18 years or older. It is based on a large stratified random sample. Potential biases are associated with non-response, incomplete interviews, missing values and convenience bias (some potential respondents may not have been included because they do not have a landline and cell phone).
Causality:
There is no causation can be established as BRFSS is an observation study that can only establish correlation/association between variables.
Part 2: Research Questions
Research quesion 1:
Does the distribution of the number of days in which physical and mental health was not good during the past 30 days differ by gender?
Research quesion 2:
Is there an association between the month in which a respondent was interviewed and the respondent’s self-reported health perception?
Research quesion 3:
Is there any association between income and health care coverage?
Research quesion 4:
Is there any relation between smoking, drinking alcohol, cholesterol level, blood pressure, weight and having a stroke? Eventually, I would like to see whether stroke can be predicted from the above mentioned variables.
Part 3: Exploratory data analysis
Research quesion 1:
The above three figures show the data distribution of how male and female responded to the number of days physical, mental and both health not good during the past 30 days. We can see that there were far more female respondents than male respondents.
Research quesion 2:
I was trying to find out whether people respond their health condition differently in the different month. For example, are people more likely to say they are in good health in the spring or summer? It appears that there was no obvious pattern.
Research quesion 3:
In general, higher income respondents are more likely to have health care coverage then those of lower income respondents.
Research quesion 4:
To answer this question, I willl be using the following varibles:
-
smoke100: Smoked At Least 100 Cigarettes
-
avedrnk2: Avg Alcoholic Drinks Per Day In Past 30
-
bphigh4: Ever Told Blood Pressure High
-
toldhi2: Ever Told Blood Cholesterol High
-
weight2: Reported Weight In Pounds
-
cvdstrk3: Ever Diagnosed With A Stroke
First, convert the above variables to numeric, and see any correlation between these numerica variables.
No any two numeric variables seem to have strong correlations.
Logistic Regression to Predict Stroke
Replace the answer “Yes, but female told only during pregnancy” and “Told borderline or pre-hypertensive” with “Yes”.
Replace ‘NA’ values with ‘No’.
Replace ‘NA’ value by average.
Have a look the data that will be used for modeling.
Covert to binary outcome.
After wrangling and cleaning the data, now we can fit the model.
Logistic Regression Model Fitting
Interpreting the results of my logistic regression model:
All the variables are statistically significant.
-
All other variables being equal, being told blood pressure high is more likely to have a stroke.
-
The negative coefficient for the predictor - toldhi2No suggests that all other variables being equal, not being told blood cholesterol high is less likely to have a stroke.
-
For every one unit change in weight, the log odds of having a stroke (versus no-stroke) decreases by 0.00096.
-
Not Smoked At Least 100 Cigarettes, less likely to have a stroke.
-
For a one unit increase in Avg alcoholic drinks per day in past 30 days, the log odds of having a stroke decreases by 0.027.
Analyzing the deviance table we can see the drop in deviance when adding each variable one at a time. Adding bphigh4, toldhi2, smoke100 significantly reduces the residual deviance. The other variables weight2 and avedrnk2 seem to imrove the model less even though they all have low p-values.
Assessing the predictive ability of the model
The 0.96 accuracy on the test set is a very good result.
Plot the ROC curve and calculate the AUC (area under the curve).
One last note, when we analyze health survery data, we must be aware that self-reported prevalence may be biased because respondents may not be aware of their risk status. Therefore, to achieve more precise estimates, researchers are using laboratory tests as well as self-reported data.
Source code that created this post can be found here. I am happy to hear any feedback and questions.