library(readr)
env_health <- read_csv("C:/Users/HP/OneDrive/Desktop/env_health.csv")
## Rows: 180 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (7): district, residence, toilet_type, water_source, handwashing_facilit...
## dbl (3): household_id, household_size, household_income
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(env_health)
library(gtsummary)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
env_health %>%
tbl_summary()
Characteristic | N = 1801 |
---|---|
household_id | 91 (46, 136) |
district | |
Barishal | 24 (13%) |
Chattogram | 21 (12%) |
Dhaka | 22 (12%) |
Khulna | 19 (11%) |
Mymensingh | 27 (15%) |
Rajshahi | 24 (13%) |
Rangpur | 23 (13%) |
Sylhet | 20 (11%) |
residence | |
Rural | 82 (46%) |
Urban | 98 (54%) |
household_size | |
2 | 26 (14%) |
3 | 20 (11%) |
4 | 23 (13%) |
5 | 27 (15%) |
6 | 18 (10%) |
7 | 28 (16%) |
8 | 21 (12%) |
9 | 17 (9.4%) |
toilet_type | |
Improved | 112 (62%) |
Open defecation | 20 (11%) |
Unimproved | 48 (27%) |
water_source | |
Piped | 75 (42%) |
Surface water | 16 (8.9%) |
Tube well | 89 (49%) |
handwashing_facility | 137 (76%) |
waste_disposal | |
Improper | 56 (31%) |
Proper | 124 (69%) |
reported_diarrhea_case | 41 (23%) |
household_income | 29,146 (17,128, 42,825) |
1 Median (Q1, Q3); n (%) |
Interpretation :
The R code:
env_health %>%
tbl_summary()
uses the gtsummary
package to produce a summary table
that presents descriptive statistics of the dataset
env_health
.
The pipe operator (%>%
) sends the dataset
env_health
into the next function.
The tbl_summary()
function automatically identifies
the types of variables in the dataset:
The result is a professionally formatted summary table showing the main characteristics of the dataset. This table helps researchers understand the overall distribution, central tendency, and composition of the data before further analysis.
The output below provides descriptive statistics for all variables in
the dataset env_health
(N = 1801 households). It includes
both numeric and categorical variables.
The descriptive summary table provides an overview of environmental health conditions across 1,801 households. Most households are urban (54%) and use improved sanitation facilities (62%), while tube wells (49%) and piped water (42%) are the dominant water sources. About three-quarters (76%) of households have handwashing facilities, yet nearly one-third (31%) still practice improper waste disposal. The occurrence of reported diarrhea (23%) indicates ongoing health risks possibly associated with sanitation and water issues. The median monthly household income is BDT 29,146, suggesting a middle-income population with significant variability.
Overall, this summary highlights mixed progress in environmental health—good access to water and sanitation in some areas, but persistent challenges in hygiene practices and waste management. These insights are crucial for designing public health interventions aimed at improving water, sanitation, and hygiene (WASH) outcomes in Bangladesh.
Final Summary
In summary, the R command
env_health %>% tbl_summary()
efficiently produces a comprehensive descriptive summary of the environmental health dataset. The resulting table displays both numeric and categorical variable summaries, allowing easy understanding of household distribution, environmental conditions, and public health indicators. The findings show relatively high coverage of improved sanitation and safe water sources, yet issues like open defecation, improper waste disposal, and diarrhea prevalence persist, emphasizing the need for continued health and hygiene interventions.
env_health %>%
tbl_summary(
by = waste_disposal)
Characteristic | Improper N = 561 |
Proper N = 1241 |
---|---|---|
household_id | 92 (59, 132) | 89 (39, 136) |
district | ||
Barishal | 7 (13%) | 17 (14%) |
Chattogram | 5 (8.9%) | 16 (13%) |
Dhaka | 10 (18%) | 12 (9.7%) |
Khulna | 8 (14%) | 11 (8.9%) |
Mymensingh | 6 (11%) | 21 (17%) |
Rajshahi | 9 (16%) | 15 (12%) |
Rangpur | 8 (14%) | 15 (12%) |
Sylhet | 3 (5.4%) | 17 (14%) |
residence | ||
Rural | 22 (39%) | 60 (48%) |
Urban | 34 (61%) | 64 (52%) |
household_size | ||
2 | 10 (18%) | 16 (13%) |
3 | 6 (11%) | 14 (11%) |
4 | 9 (16%) | 14 (11%) |
5 | 10 (18%) | 17 (14%) |
6 | 3 (5.4%) | 15 (12%) |
7 | 8 (14%) | 20 (16%) |
8 | 7 (13%) | 14 (11%) |
9 | 3 (5.4%) | 14 (11%) |
toilet_type | ||
Improved | 35 (63%) | 77 (62%) |
Open defecation | 6 (11%) | 14 (11%) |
Unimproved | 15 (27%) | 33 (27%) |
water_source | ||
Piped | 24 (43%) | 51 (41%) |
Surface water | 7 (13%) | 9 (7.3%) |
Tube well | 25 (45%) | 64 (52%) |
handwashing_facility | 45 (80%) | 92 (74%) |
reported_diarrhea_case | 9 (16%) | 32 (26%) |
household_income | 30,717 (17,470, 43,876) | 28,562 (17,128, 42,327) |
1 Median (Q1, Q3); n (%) |
Interpretation :
The code:
env_health %>%
tbl_summary(by = waste_disposal)
was used to generate descriptive statistics of household and environmental characteristics, stratified by waste disposal type (i.e., Improper vs. Proper disposal).
The function tbl_summary()
from the
gtsummary
package automatically summarizes numeric
variables using median (Q1, Q3) and categorical variables using
frequency and percentage [n (%)].
This comparison helps identify whether households with proper waste disposal practices differ in key environmental and health characteristics compared to those with improper practices.
Out of 1,801 households:
This indicates that while most households manage waste correctly, a significant portion still dispose waste improperly, posing environmental and public health risks.
Socio-Demographic Patterns
Environmental and Sanitation Factors
Health Outcome (Diarrhea Cases)
Interestingly, the proportion of households reporting diarrhea cases is higher among those with proper disposal (26%) than those with improper disposal (16%). This counterintuitive result could be due to:
The stratified summary reveals that households practicing proper waste disposal are slightly more rural, have similar income levels, and show marginally better access to improved water sources. However, health outcomes such as reported diarrhea do not appear to differ positively for the proper disposal group, suggesting the presence of additional environmental or behavioral risk factors.
These findings highlight that while waste management practices are improving, complementary interventions — such as improving water quality, ensuring consistent sanitation infrastructure, and promoting hygiene behavior — are necessary to achieve better public health outcomes.
Final Summary
The R code
env_health %>% tbl_summary(by = waste_disposal)
produces a stratified summary comparing household and environmental characteristics by type of waste disposal. Among 1,801 households, 31% practiced improper waste disposal and 69% proper disposal. The analysis shows relatively balanced socio-economic characteristics between the two groups, with proper waste disposal slightly more common among rural households and those using safer water sources. Although sanitation access is similar in both groups, the higher prevalence of reported diarrhea among households with proper disposal suggests other influencing factors beyond waste management alone. The results emphasize that effective environmental health outcomes depend on multiple integrated factors — water quality, sanitation, hygiene behavior, and community infrastructure — rather than waste disposal practices in isolation.
model <- glm( factor(waste_disposal) ~ residence + household_size + toilet_type + water_source + handwashing_facility + reported_diarrhea_case + household_income, data = env_health, family = "binomial")
tbl_regression(model)
Characteristic | log(OR) | 95% CI | p-value |
---|---|---|---|
residence | |||
Rural | — | — | |
Urban | -0.39 | -1.1, 0.29 | 0.3 |
household_size | 0.11 | -0.04, 0.26 | 0.2 |
toilet_type | |||
Improved | — | — | |
Open defecation | 0.11 | -0.94, 1.2 | 0.8 |
Unimproved | 0.06 | -0.69, 0.84 | 0.9 |
water_source | |||
Piped | — | — | |
Surface water | -0.59 | -1.7, 0.58 | 0.3 |
Tube well | 0.21 | -0.49, 0.91 | 0.6 |
handwashing_facility | |||
No | — | — | |
Yes | -0.25 | -1.1, 0.55 | 0.5 |
reported_diarrhea_case | |||
No | — | — | |
Yes | 0.66 | -0.15, 1.5 | 0.13 |
household_income | 0.00 | 0.00, 0.00 | 0.7 |
Abbreviations: CI = Confidence Interval, OR = Odds Ratio |
Interpretation :
Interpretation of the Logistic Regression Analysis
This logistic regression model examines the factors associated with household waste disposal practices** (proper vs. improper).
The dependent variable (waste_disposal) is binary:
The independent (predictor) variables are:
The model uses a binomial family (logit link), which estimates the log-odds of having proper waste disposal given these predictors.
In this model, none of the predictors are statistically significant, meaning that there is no strong evidence that the tested variables independently influence waste disposal practices at the 5% significance level.
Residence
Household Size
Toilet Type
Water Source
Handwashing Facility Contrary to expectations, having a handwashing facility is not associated with better waste disposal, which might suggest a gap between infrastructure availability and behavior.
Reported Diarrhea Cases
The positive coefficient (0.66) implies households reporting diarrhea were more likely to dispose waste properly.
This could reflect reactive behavior—households adopting cleaner practices after illness occurs—though the result is not significant (p = 0.13).
Household Income
The coefficient for income is near zero, suggesting economic status does not meaningfully predict waste disposal practices in this sample.
The logistic regression model indicates that, although some variables (such as water source, residence, and diarrhea cases) show trends in the expected directions, none of the relationships are statistically significant at the 5% level. This suggests that proper waste disposal behavior in this population is not strongly determined by socioeconomic or environmental factors alone, but may depend on community-level infrastructure, awareness campaigns, or municipal services not captured in the model.
From a public health standpoint:
The lack of significant predictors implies that improving waste disposal may require broader interventions, such as community-based programs, municipal collection systems, and behavioral change communication, rather than focusing solely on household demographics.
Even though income and facilities are available, behavioral and systemic barriers may prevent proper waste disposal.
Final Summary
The binary logistic regression model assessed the association between household characteristics and waste disposal practices. None of the predictor variables, including residence, household size, toilet type, water source, handwashing facilities, reported diarrhea, or household income, were statistically significant predictors of proper waste disposal (p > 0.05). Although urban households, surface water users, and those without handwashing facilities tended to have lower odds of proper waste disposal, these relationships were weak and not significant. The findings suggest that waste management behaviors in the study population are influenced by complex social and infrastructural factors beyond household-level characteristics. Therefore, policy efforts should focus on improving waste management systems, community awareness, and sanitation infrastructure to promote environmentally safe practices.