This report uses data from the 2022 Medical Expenditure Panel Survey (MEPS) Full-Year Consolidated Data File, HC-243. The purpose of this analysis is to examine relationships between healthcare expenditures, age, chronic health conditions, and healthcare utilization among adults.
Dataset source: https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=HC-243
h243 <- read.csv("h243.csv")
head(h243)
TOTEXP22 - Total healthcare expenditures in 2022AGE22X - Age as of December 31, 2022ADBMI42 - Adult BMIDIABDX_M18 - Diabetes diagnosisHIBPDX - High blood pressure diagnosisERTOT22 - Number of emergency room visits in 2022healthcare <- h243[, c(
"TOTEXP22",
"AGE22X",
"ADBMI42",
"DIABDX_M18",
"HIBPDX",
"ERTOT22"
)]
head(healthcare)
## TOTEXP22 AGE22X ADBMI42 DIABDX_M18 HIBPDX ERTOT22
## 1 15766 77 35.7 1 1 0
## 2 12697 64 -1.0 2 1 2
## 3 3405 67 -1.0 2 2 0
## 4 9265 29 -1.0 2 2 0
## 5 3362 51 27.4 2 2 0
## 6 35 58 20.8 2 2 0
Before performing the analysis, I cleaned special negative values that represent missing or inapplicable responses. I also restricted the analysis to adults age 18 and older.
healthcare$ADBMI42[healthcare$ADBMI42 < 0] <- NA
healthcare$DIABDX_M18[healthcare$DIABDX_M18 < 0] <- NA
healthcare$HIBPDX[healthcare$HIBPDX < 0] <- NA
healthcare$DIABDX_M18 <- ifelse(
healthcare$DIABDX_M18 == 1, 1,
ifelse(healthcare$DIABDX_M18 == 2, 0, NA)
)
healthcare$HIBPDX <- ifelse(
healthcare$HIBPDX == 1, 1,
ifelse(healthcare$HIBPDX == 2, 0, NA)
)
healthcare_adult <- healthcare[
healthcare$AGE22X >= 18,
]
dim(healthcare_adult)
## [1] 17909 6
I plotted age against total annual healthcare expenditures. This graph allows me to visually examine whether healthcare expenditures tend to change as age increases.
plot(
healthcare_adult$AGE22X,
healthcare_adult$TOTEXP22,
main = "Age vs. Total Healthcare Expenditures",
xlab = "Age (Years)",
ylab = "Total Healthcare Expenditures ($)",
pch = 16,
cex = 0.5
)
The scatter plot shows the relationship between age and total healthcare expenditures among adults. Most individuals had relatively low healthcare expenditures, while a smaller number had very high expenditures. The graph also shows several extreme values, including expenditures above $1 million.
There appears to be a slight tendency for healthcare expenditures to increase with age, but the relationship is not strong based on the scatter plot alone. A statistical test will be used later in the analysis to determine the strength and significance of the relationship between age and healthcare expenditures.
To better understand healthcare expenditures in the adult sample, I calculated the mean and median total annual healthcare expenditures. Comparing the mean and median is useful because the previous graph showed several individuals with extremely high healthcare expenditures.
mean_expenditure <- mean(
healthcare_adult$TOTEXP22,
na.rm = TRUE
)
median_expenditure <- median(
healthcare_adult$TOTEXP22,
na.rm = TRUE
)
mean_expenditure
## [1] 8711.576
median_expenditure
## [1] 2172
The mean total annual healthcare expenditure was approximately $8,711.58, while the median was $2,172. The mean is much higher than the median, which suggests that healthcare expenditures are right-skewed. A relatively small number of individuals with very high healthcare expenditures increase the mean.
The median indicates that half of the adults in the sample had healthcare expenditures below $2,172 and half had expenditures above $2,172. These results are consistent with the scatter plot in Question 1, which showed that most expenditures were concentrated at lower values while a small number of individuals had extremely high expenditures.
To determine whether there is a statistically significant relationship between age and total healthcare expenditures, I performed a Pearson correlation test. I also used a simple linear regression to calculate R-squared.
correlation_test <- cor.test(
healthcare_adult$AGE22X,
healthcare_adult$TOTEXP22,
method = "pearson"
)
correlation_test
##
## Pearson's product-moment correlation
##
## data: healthcare_adult$AGE22X and healthcare_adult$TOTEXP22
## t = 20.865, df = 17907, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1397278 0.1683246
## sample estimates:
## cor
## 0.1540585
age_model <- lm(
TOTEXP22 ~ AGE22X,
data = healthcare_adult
)
summary(age_model)
##
## Call:
## lm(formula = TOTEXP22 ~ AGE22X, data = healthcare_adult)
##
## Residuals:
## Min 1Q Median 3Q Max
## -15338 -7968 -4623 -765 1336034
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1528.54 521.49 -2.931 0.00338 **
## AGE22X 198.43 9.51 20.865 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 23590 on 17907 degrees of freedom
## Multiple R-squared: 0.02373, Adjusted R-squared: 0.02368
## F-statistic: 435.3 on 1 and 17907 DF, p-value: < 2.2e-16
plot(
healthcare_adult$AGE22X,
healthcare_adult$TOTEXP22,
main = "Age and Total Healthcare Expenditures",
xlab = "Age (Years)",
ylab = "Total Healthcare Expenditures ($)",
pch = 16,
cex = 0.5
)
abline(
age_model,
col = "red",
lwd = 2
)
The Pearson correlation coefficient between age and total healthcare expenditures was approximately 0.154, indicating a weak positive relationship. The p-value was less than 0.001, indicating that the relationship was statistically significant.
The simple linear regression produced an R-squared value of approximately 0.024. This means that age alone explained about 2.4% of the variation in total healthcare expenditures. The regression coefficient for age was approximately 198.43, meaning that each additional year of age was associated with an estimated $198 increase in annual healthcare expenditures.
The scatter plot and regression line are consistent with these results. The regression line slopes upward, indicating that expenditures tend to increase with age. However, the points are widely dispersed and several extreme expenditures are present, showing that age alone does not explain most of the variation in healthcare spending.
To examine the distribution of total annual healthcare expenditures,
I created a histogram of TOTEXP22.
hist(
healthcare_adult$TOTEXP22,
main = "Distribution of Total Healthcare Expenditures",
xlab = "Total Healthcare Expenditures ($)",
ylab = "Frequency",
breaks = 50
)
The histogram shows that total annual healthcare expenditures are strongly right-skewed. Most adults had expenditures concentrated at the lower end of the distribution, while a relatively small number had very high healthcare expenditures. These high values create a long tail extending to the right.
The distribution is therefore not approximately normal. This is also consistent with the descriptive statistics from Question 2, where the mean expenditure ($8,711.58) was substantially higher than the median expenditure ($2,172). The extreme expenditures pull the mean upward.
For the second statistical test, I examined whether total healthcare
expenditures differed between adults with and without diabetes. The
numerical variable was total healthcare expenditures
(TOTEXP22), and the grouping variable was diabetes
diagnosis (DIABDX_M18), where 0 represents no diabetes and
1 represents diabetes.
table(
healthcare_adult$DIABDX_M18,
useNA = "ifany"
)
##
## 0 1 <NA>
## 15345 2486 78
aggregate(
TOTEXP22 ~ DIABDX_M18,
data = healthcare_adult,
FUN = median
)
## DIABDX_M18 TOTEXP22
## 1 0 1738
## 2 1 8602
aggregate(
TOTEXP22 ~ DIABDX_M18,
data = healthcare_adult,
FUN = mean
)
## DIABDX_M18 TOTEXP22
## 1 0 7438.027
## 2 1 16823.532
For this analysis, I used a two-sample t-test to compare mean healthcare expenditures between adults with and without diabetes.
Null hypothesis (H0): There is no significant difference in mean total healthcare expenditures between adults with diabetes and adults without diabetes.
Alternative hypothesis (H1): There is a significant difference in mean total healthcare expenditures between adults with diabetes and adults without diabetes.
Although the histogram showed that healthcare expenditures are strongly right-skewed, the two groups contain a large number of observations. I used Welch’s two-sample t-test, which does not require the two groups to have equal variances.
diabetes_ttest <- t.test(
TOTEXP22 ~ DIABDX_M18,
data = healthcare_adult
)
diabetes_ttest
##
## Welch Two Sample t-test
##
## data: TOTEXP22 by DIABDX_M18
## t = -17.405, df = 3222.7, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -10442.817 -8328.192
## sample estimates:
## mean in group 0 mean in group 1
## 7438.027 16823.532
The Welch two-sample t-test found a statistically significant difference in mean healthcare expenditures between adults with and without diabetes, t(3222.8) = -17.405, p < 0.001.
Adults without diabetes had mean annual healthcare expenditures of approximately $7,438.03, while adults with diabetes had mean annual expenditures of approximately $16,823.53. Therefore, adults with diabetes spent approximately $9,385 more on healthcare per year on average than adults without diabetes in this sample.
The 95% confidence interval for the difference in means (no diabetes minus diabetes) ranged from approximately -$10,443 to -$8,328. Because this interval does not include zero, it provides additional evidence of a significant difference between the groups.
Based on these results, I reject the null hypothesis. The results suggest that diabetes status is associated with differences in healthcare expenditures among adults in this sample.
This analysis examined relationships between age, chronic health conditions, and healthcare expenditures among adults in the 2022 MEPS dataset. Total healthcare expenditures were strongly right-skewed, with most adults having relatively low expenditures and a smaller number having extremely high expenditures.
Age had a statistically significant but weak positive relationship with healthcare expenditures. Although expenditures tended to increase with age, age alone explained only about 2.4% of the variation in healthcare spending.
Diabetes status showed a substantial difference in healthcare expenditures. Adults with diabetes had significantly higher mean annual healthcare expenditures than adults without diabetes. Overall, the results suggest that both age and chronic health conditions are associated with healthcare spending, although many additional factors likely contribute to differences in healthcare expenditures.