From 100f26c4694de846fcbb87378781b63377708b2e Mon Sep 17 00:00:00 2001 From: andrew-phillips-1 <39617310+andrew-phillips-1@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:08:01 +0100 Subject: [PATCH 1/3] Updating testing code previously the second term could be negative and hence result in lowering of testing rate before 2009. I hope this takes care of it ? --- hiv_synthesis.sas | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hiv_synthesis.sas b/hiv_synthesis.sas index bf63a0bb..5d809a15 100644 --- a/hiv_synthesis.sas +++ b/hiv_synthesis.sas @@ -3076,7 +3076,7 @@ end; * RATE OF TESTING WHEN HAVE non_tb_who3, WHO4 or TB and for GENERAL POPULATION; -if date_start_testing lt caldate{t} le 2015 then do; + test_rate_who4 = min(0.9,test_rate_who4*incr_test_rate_sympt); test_rate_tb = min(0.8,test_rate_tb*incr_test_rate_sympt); test_rate_non_tb_who3 = min(0.7,test_rate_non_tb_who3*incr_test_rate_sympt); * 0.7 mar19; @@ -3090,18 +3090,21 @@ if date_start_testing lt caldate{t} le 2015 then do; np_lasttest=0; newp_lasttest_tested_this_per=newp_lasttest; newp_lasttest=0; end; end; -end; + tested_anc=.; -if t ge 2 and date_start_testing <= caldate{t} then do; +if t ge 2 and date_start_testing <= caldate{t} then do; * note that date_start_testing is never changed from 2003.5; - rate_1sttest = initial_rate_1sttest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; - rate_reptest = 0.0000 + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; - rate_1sttest_2011 = initial_rate_1sttest + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; - rate_reptest_2011 = 0.0000 + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_1sttest = initial_rate_1sttest; rate_reptest = 0; + if caldate{t} >= date_start_testing+5.5 then do; + rate_1sttest = initial_rate_1sttest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_reptest = 0.0000 + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_1sttest_2011 = initial_rate_1sttest + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_reptest_2011 = 0.0000 + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + end; if gender=2 then do; rate_1sttest = rate_1sttest * rr_testing_female ; rate_reptest = rate_reptest * rr_testing_female ; end; end; From 28b60608bc3ec12999188a8634ee8505eb8c579e Mon Sep 17 00:00:00 2001 From: andrew-phillips-1 <39617310+andrew-phillips-1@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:42:48 +0100 Subject: [PATCH 2/3] Update hiv_synthesis.sas --- hiv_synthesis.sas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hiv_synthesis.sas b/hiv_synthesis.sas index 5d809a15..aa3a704f 100644 --- a/hiv_synthesis.sas +++ b/hiv_synthesis.sas @@ -3076,7 +3076,7 @@ end; * RATE OF TESTING WHEN HAVE non_tb_who3, WHO4 or TB and for GENERAL POPULATION; - +if date_start_testing lt caldate{t} le 2015 then do; test_rate_who4 = min(0.9,test_rate_who4*incr_test_rate_sympt); test_rate_tb = min(0.8,test_rate_tb*incr_test_rate_sympt); test_rate_non_tb_who3 = min(0.7,test_rate_non_tb_who3*incr_test_rate_sympt); * 0.7 mar19; @@ -3090,7 +3090,7 @@ end; np_lasttest=0; newp_lasttest_tested_this_per=newp_lasttest; newp_lasttest=0; end; end; - +end; From d2fa77fb6f95d3d1d29b2ea628cb6f8cc064d864 Mon Sep 17 00:00:00 2001 From: andrew-phillips-1 <39617310+andrew-phillips-1@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:29:59 +0100 Subject: [PATCH 3/3] update updated as agreed --- hiv_synthesis.sas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hiv_synthesis.sas b/hiv_synthesis.sas index aa3a704f..a925b68d 100644 --- a/hiv_synthesis.sas +++ b/hiv_synthesis.sas @@ -334,6 +334,7 @@ newp_seed = 7; * date_start_testing; date_start_testing = 2003.5; * initial_rate_1sttest; initial_rate_1sttest = 0; * dependent_on_time_step_length ; +* initial_rate_reptest; initial_rate_reptest = 0; * test_rate_who4; test_rate_who4=0.10; * dependent_on_time_step_length ; * test_rate_tb; test_rate_tb =0.10; * dependent_on_time_step_length ; * test_rate_non_tb_who3; test_rate_non_tb_who3=0.05; * dependent_on_time_step_length ; @@ -3098,12 +3099,12 @@ tested_anc=.; if t ge 2 and date_start_testing <= caldate{t} then do; * note that date_start_testing is never changed from 2003.5; - rate_1sttest = initial_rate_1sttest; rate_reptest = 0; + rate_1sttest = initial_rate_1sttest; rate_reptest = initial_rate_reptest; if caldate{t} >= date_start_testing+5.5 then do; rate_1sttest = initial_rate_1sttest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; - rate_reptest = 0.0000 + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_reptest = initial_rate_reptest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; rate_1sttest_2011 = initial_rate_1sttest + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; - rate_reptest_2011 = 0.0000 + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; + rate_reptest_2011 = initial_rate_reptest + (min(2011,date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test; end; if gender=2 then do; rate_1sttest = rate_1sttest * rr_testing_female ; rate_reptest = rate_reptest * rr_testing_female ; end; @@ -3115,7 +3116,7 @@ if caldate{t} >= 2022 then do; ***Assuming testing rates are stable after 2022 by multiplying by fold_rate_decr_test_future; if incr_test_year_i = 3 then do; rate_1sttest = initial_rate_1sttest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test - ((caldate{t}-2022 )*an_lin_incr_test*fold_rate_decr_test_future); - rate_reptest = 0.0000 + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test - ((caldate{t}-2022)*an_lin_incr_test*fold_rate_decr_test_future); + rate_reptest = initial_rate_reptest + (min(caldate{t},date_test_rate_plateau)-(date_start_testing+5.5))*an_lin_incr_test - ((caldate{t}-2022)*an_lin_incr_test*fold_rate_decr_test_future); if gender=2 then do; rate_1sttest = rate_1sttest * rr_testing_female ; rate_reptest = rate_reptest * rr_testing_female ; end; if . lt rate_1sttest lt rate_1sttest_2011 then rate_1sttest = rate_1sttest_2011; if . lt rate_reptest lt rate_reptest_2011 then rate_reptest = rate_reptest_2011;