install.packages("table1")
install.packages("broom")
install.packages("kableExtra")Homework 3 and 4: Applied PH Data Analysis
10 points
Pre-requisite
This assignment requires these additional packages. If you need to install these packages, please run the code chunk below by changing eval from FALSE to TRUE.
Delete the code chunk above before proceeding
Case Study: The Heart Health and Lifestyle Study (HHLS) Background
The Heart Health and Lifestyle Study (HHLS) is a research initiative aiming to understand how different lifestyle factors contribute to the risk of developing heart disease. Researchers have collected data from a diverse group of 1,000 individuals aged between 30 and 70 years.
Data Collected
The HHLS dataset includes the following variables:
Age: Age of the participants (30-70 years).
Gender: Gender of the participants (Male/Female).
Smoking Status: Whether the participant is a smoker or non-smoker.
Exercise Frequency: Categorized as None, Low, Moderate, or High.
Diet Quality: Rated as Poor, Average, or Good.
Heart Disease Status: Whether the participant has heart disease (Yes/No).
Objectives for the Assignment
Odds Ratio Calculation: Determine and interpret the odds ratio to assess the association between smoking status and heart disease risk.
Regression Analysis: Perform logistic regression to evaluate the impact of lifestyle factors on heart disease and interpret the significance of each factor.
Controlling for Confounders: Identify potential confounders like age and gender, and adjust the analysis to assess their influence on the relationship between lifestyle factors and heart disease.
Interdisciplinary Application and Critical Analysis: Apply study findings to inform public health policies and healthcare strategies, and critically evaluate the statistical methods and potential biases in the study design.
Assignment Tasks
Students are expected to complete the following tasks and answer the questions that follow using the HHLS dataset provided.
Deliverables
A comprehensive Quarto pdf document containing all analyses, code, and interpretations. Output and tables to support the findings. A final conclusion summarizing the key insights from the study.
This case study provides a practical and structured approach for students to apply biostatistical methods in a real-world context, enhancing their understanding of how statistical analysis can be used to uncover important health insights.
A sample of the dataset is shown below.
| age | gender | smoking_status | exercise_frequency | diet_quality | heart_disease_status |
|---|---|---|---|---|---|
| 49 | Male | Smoker | None | Average | Yes |
| 30 | Female | Non-Smoker | High | Average | No |
| 47 | Male | Non-Smoker | Moderate | Average | No |
| 49 | Male | Smoker | None | Good | Yes |
| 42 | Female | Non-Smoker | None | Average | Yes |
| 50 | Female | Non-Smoker | High | Average | No |
| No (N=673) |
Yes (N=327) |
Overall (N=1000) |
|
|---|---|---|---|
| age | |||
| Mean (SD) | 49.4 (10.7) | 50.7 (11.3) | 49.8 (10.9) |
| Median [Min, Max] | 49.0 [30.0, 70.0] | 51.0 [30.0, 70.0] | 50.0 [30.0, 70.0] |
| factor(gender) | |||
| Female | 376 (55.9%) | 129 (39.4%) | 505 (50.5%) |
| Male | 297 (44.1%) | 198 (60.6%) | 495 (49.5%) |
| factor(exercise_frequency) | |||
| High | 151 (22.4%) | 56 (17.1%) | 207 (20.7%) |
| Low | 204 (30.3%) | 94 (28.7%) | 298 (29.8%) |
| Moderate | 136 (20.2%) | 56 (17.1%) | 192 (19.2%) |
| None | 182 (27.0%) | 121 (37.0%) | 303 (30.3%) |
| factor(diet_quality) | |||
| Average | 289 (42.9%) | 199 (60.9%) | 488 (48.8%) |
| Good | 384 (57.1%) | 128 (39.1%) | 512 (51.2%) |
| factor(smoking_status) | |||
| Non-Smoker | 558 (82.9%) | 162 (49.5%) | 720 (72.0%) |
| Smoker | 115 (17.1%) | 165 (50.5%) | 280 (28.0%) |
Question 1. Describe the sample, for reference, see the first paragraph of the results section of any original research article. (1 point)
This sample includes 1000 participants between the ages of 30 and 70 years old with a median age of 50. 50.5% of participants are female. 30.3% of sampled persons did not exercise, 29.8% engaged in low levels of exercise, with another 19.2% engaging in moderate and 20.7% in high levels of exercise. 51.2% of participants report a good diet and 72% report being nonsmokers. The table categorizes sample based on self-reported heart disease status in which males make up 60.6% of those reporting heart disease, and those report less exercise, poorer diet and being a smoker also being more likely to report the disease.
Question 2: What is the Odds ratio of the association between smoking status and heart disease?
Odds ratio: A X D/ B X C = O.R.
A= 165 (exposed, diseased) B = 115 (exposed, not diseased) C = 162 (not exposed, diseased) D = 558 (not exposed, not diseased)
Odds Ratio: 165 X 558/115 x 162 = 4.942
- Based on the odds ratio calculated, how would you interpret the strength and direction of the association between smoking status and heart disease to a non-technical audience? Consider whether it suggests a risk or protective factor for heart disease.
The odds ratio for smoking being associated with (not a cause of) heart disease is 4.92, indicating the ratio of a smoker in the study’s odds of contracting heart disease as compared to a nonsmoker’s odds of contracting heart disease. In other words, smokers in the study are almost 5 times more likely to have heart disease than nonsmokers, confirming this exposure is positively associated with heart disease and, thus, a risk factor for the disease.
Question 3a: What variables would be potential confounders of the relationship between smoking and heart disease? Explain your answer. (0.5 points)
In this study, there would appear to be three confounders in assessing the relationship between smoking and heart disease: gender, exercise habits and diet. There is a positive association between being male and heart disease, as well as with poor diet and no or little exercise. These could all be contributing factors to heart disease, confounding our ability to understand the actual causal effect of smoking.
Question 3b: Which model would you use to test the association after controlling for the confounders listed above? Why? (0.5 points)
In a study with multiple independent variables, or predictors, associated with the outcome of a dependent variable, we would want to use a multiple linear regression model. This type of regression modeling allows us to estimate for an association between our response variable (heart disease) and our primary predictor of interest (smoking) while adjusting for possible confounding variables (exercise, diet and gender), and then allowing us to construct a model that effectively explains the actual, observed variation in the response variable.
Regression analysis model The model is fit below and the resulting odds ratio is given
Waiting for profiling to be done...
OR 2.5 % 97.5 %
(Intercept) 0.29 0.24 0.34
smoking_statusSmoker 4.94 3.68 6.66
Question 4: Interpret the odds ratio from the model above. How does it compare to the odds ratio from question 2. (1 point)
The odds ratio for our primary predictor of interest in the regression analysis is 4.94,approximately the same as the Odds Ratio from the cross-tabulation tables, within the 95% confidence interval range of odds ratios for the predictor – 3.68 to 6.66.
Question 5: A model was fit to control for potential confounders. The resulting analysis table is shown below. Which variables are significant predictors of heart disease? Interpret the results for smoking and compare to the previous result. (1 point)
In an odds ratio, any value above 1.0 establishes an association. A statistically significant association at the 95% confidence level would have a “range” of odds ratios entirely above 1.0. In our regression analysis, we see that the the Male gender, “None” reported exercise and smoking status are all significantly associated. The smoking odds ratio in this analysis is larger, suggesting that the confounders actually were muting the true strength of the postiive association between smoking and heart disease.
Waiting for profiling to be done...
OR 2.5 % 97.5 %
(Intercept) 0.15 0.07 0.34
smoking_statusSmoker 5.27 3.87 7.22
age 1.01 0.99 1.02
genderMale 1.93 1.44 2.60
exercise_frequencyLow 1.18 0.77 1.82
exercise_frequencyModerate 1.00 0.61 1.62
exercise_frequencyNone 1.93 1.27 2.95
diet_qualityGood 0.46 0.34 0.62
Model comparison The summary for the first model without confounders is given below
# A tibble: 1 × 8
null.deviance df.null logLik AIC BIC deviance df.residual nobs
<dbl> <int> <dbl> <dbl> <dbl> <dbl> <int> <int>
1 1264. 999 -573. 1151. 1161. 1147. 998 1000
The summary for the second model with confounders is given below
# A tibble: 1 × 8
null.deviance df.null logLik AIC BIC deviance df.residual nobs
<dbl> <int> <dbl> <dbl> <dbl> <dbl> <int> <int>
1 1264. 999 -541. 1099. 1138. 1083. 992 1000
Question 6: Compare the AIC to determine which one explains the outcome best. Lower AIC is better fit to the data. (1 point)
AIC is a statistical calculation to evaluate how well a regression model fits the data it was generated from, and is used to compare different models in order to determine which one “fits” best for the data. The “best-fitting” model is the one that explains the greatest amount of variation using the fewest independent variables.The lower the AIC score, the better the fit becuase it uses fewer variables. Here, we see a lower AIC score from the second model which includes the confounders, confirming that the confounders are necessary to modelling the impact of smoking and need to be included notwithstanding the preference to use fewer variables.
Question 7: Re-analyze for older participants
Repeat the analysis excluding participants under 40 years of age. Re-evaluate the association between smoking and heart disease in this older subset and compare the results with those from the entire dataset.
Waiting for profiling to be done...
OR 2.5 % 97.5 %
(Intercept) 0.06 0.02 0.19
smoking_statusSmoker 5.69 4.05 8.05
age 1.02 1.00 1.04
genderMale 1.86 1.34 2.59
exercise_frequencyLow 1.25 0.78 2.02
exercise_frequencyModerate 1.00 0.59 1.70
exercise_frequencyNone 1.91 1.20 3.07
diet_qualityGood 0.46 0.33 0.64
Write a short description of the result for a non-technical audience. Be sure to compare to previous results. (1 point)
In this regression analysis, younger participants have been removed from the sample, leaving only 40 to 70 year olds. With this skew older in median age, we can expect to see the impacts of smoking on older persons. Note: we do not know any specific data on how long people have been smoking, so should resist concluding anything about older samples meaning more prolonged exposure to smoking. In fact, we see a somewhat higher odds ratio, statistically significant to the 95% level, than in the original sample of 30 to 70 year olds.We do NOT see a similar trend in gender, exercise or diet, suggesting that older participants were most effected by smoking.
Question 8: Summarize your findings from this analysis. (1 point)
With the help of multilinear regression analysis, we see that the primary predictor of heart disease in this sample of 1000 participants was smoking, while diet, exercise and gender are all also associated with the disease. By looking at the confounding variables we see that smoking is far and away the clearest association with the disease.
Part 2 (2 points)
Public Health Policy Implications: (1 point)
- How could the findings of this study inform public health policies related to heart disease prevention? Consider aspects like smoking cessation programs, dietary guidelines, or exercise initiatives.
Recognizing that there may be a range of other confounders we haven’t addresses, the strong association between smoking and heart disease certainly recommends prioritizing public health education efforts on the deleterious impacts of smoking on heart health. While smoking cessation efforts are important, additional efforts on discouraging young people from beginning smoking is as critical, due to the addictive nature of nicotine. Further, overall efforts to promote healthy diet and exercise should be promoted in policy, where we know these healthy life practices also can reduce heart disease. I think a specific area of focus could be on middle-aged persons who do little to no exercise, both smokers and nonsmokers, targeting them for a holistic health approach that incorporates exercises and healthy diet into daily living.
Limitations (1 point)
- Identify and discuss the limitations of the statistical methods used in this study. How might these limitations affect the interpretation and validity of the results?
As already mentioned, one important limitation is the ability to conclude causation from this data. Odds ratios help us understand association but we can’t attribute cause (though we can, by addressing the confounders, move a bit closer to understanding it as a causal factor).
Second, we have to be careful not to conclude from the higher odds ratio for smokers who are older that it is from prolonged exposure to smoking. This is important because it might be that only a short time smoking is enough exposure to have the effect of greater heart disease–we just don’t know because it wasn’t examined.
- What potential biases are present in the study design or data collection methods. How could these biases impact the study’s conclusions?
We dont have a lot of info on the study design but it appears to be a cross-sectional survey in which individuals self-report health status. Presumably this is anonymous, but one bias that is always present is the bias against self-reporting behaviors which might be criticized. Smokers are increasingly held in low regard. The two choices – smoker and nonsmoker – seem to leave the door open to under-reporting on smoking status because of the bias against sharing this info– an occasional smoker, thus, reports as being a nonsmoker because of the questionnaire design.
Noting further, though we dont know much about the recruitment process for the study, that there is potential selection bias, given that many of those motivated to know more about their health may choose to participate. Assuming those more motivated are more likely to take positive steps towards healthy practices, this could skew the sample towards a healthier set of reported statuses than in the general population.