From 694d517e9c7c72bdaa160bd0e42b233f67c14a6c Mon Sep 17 00:00:00 2001 From: Viyaasan Mahalingasivam Date: Wed, 4 Sep 2024 11:34:23 +0100 Subject: [PATCH] Fixed error --- analysis/hrg2.do | 7 ++++--- analysis/hrg3.do | 8 +++----- analysis/hrg4.do | 8 +++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/analysis/hrg2.do b/analysis/hrg2.do index 98b6a07..aa1a2c3 100644 --- a/analysis/hrg2.do +++ b/analysis/hrg2.do @@ -121,15 +121,16 @@ local `hrg'_count_`i' = round(r(N),5) qui su total_`hrg'_admissions if ckd_group==`i' local `hrg'_admissions_`i' = r(mean) if ``hrg'_count_`i'' >5 & ``hrg'_count_`i''!=. { -file write tablecontent _tab (``hrg'_count_`i'') _tab (``hrg'_admissions_`i'') _tab (``hrg'_days_`i'') +file write tablecontent _tab (``hrg'_count_`i'') _tab (``hrg'_admissions_`i'') } else { -file write tablecontent _tab ("REDACTED") _tab ("REDACTED") _tab ("REDACTED") +file write tablecontent _tab ("REDACTED") _tab ("REDACTED") } } -file write tablecontent _n drop total_`hrg'_admissions drop `hrg'_count +file write tablecontent _n } + file close tablecontent \ No newline at end of file diff --git a/analysis/hrg3.do b/analysis/hrg3.do index a227a3b..c59e86e 100644 --- a/analysis/hrg3.do +++ b/analysis/hrg3.do @@ -119,11 +119,7 @@ forvalues i=1/5 { qui safecount if ckd_group==`i' & `hrg'_count==1 local `hrg'_count_`i' = round(r(N),5) qui su total_`hrg'_admissions if ckd_group==`i' -local total_`hrg'_admissions_`i' = r(mean) -} -drop total_`hrg'_admissions -drop `hrg'_count -forvalues i=1/5 { +local `hrg'_admissions_`i' = r(mean) if ``hrg'_count_`i'' >5 & ``hrg'_count_`i''!=. { file write tablecontent _tab (``hrg'_count_`i'') _tab (``hrg'_admissions_`i'') } @@ -131,6 +127,8 @@ else { file write tablecontent _tab ("REDACTED") _tab ("REDACTED") } } +drop total_`hrg'_admissions +drop `hrg'_count file write tablecontent _n } diff --git a/analysis/hrg4.do b/analysis/hrg4.do index ad2158c..5dbef78 100644 --- a/analysis/hrg4.do +++ b/analysis/hrg4.do @@ -119,11 +119,7 @@ forvalues i=1/5 { qui safecount if ckd_group==`i' & `hrg'_count==1 local `hrg'_count_`i' = round(r(N),5) qui su total_`hrg'_admissions if ckd_group==`i' -local total_`hrg'_admissions_`i' = r(mean) -} -drop total_`hrg'_admissions -drop `hrg'_count -forvalues i=1/5 { +local `hrg'_admissions_`i' = r(mean) if ``hrg'_count_`i'' >5 & ``hrg'_count_`i''!=. { file write tablecontent _tab (``hrg'_count_`i'') _tab (``hrg'_admissions_`i'') } @@ -131,6 +127,8 @@ else { file write tablecontent _tab ("REDACTED") _tab ("REDACTED") } } +drop total_`hrg'_admissions +drop `hrg'_count file write tablecontent _n }