Skip to content

Commit

Permalink
Merge pull request #291 from UCL/andrew_pr_15
Browse files Browse the repository at this point in the history
Updating testing code
  • Loading branch information
andrew-phillips-1 authored Jun 5, 2024
2 parents 4738faf + d2fa77f commit 1c43534
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions hiv_synthesis.sas
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down Expand Up @@ -3076,7 +3077,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;
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;
Expand All @@ -3090,18 +3091,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;
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 = 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 = 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 = 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;

end;
Expand All @@ -3112,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;
Expand Down

0 comments on commit 1c43534

Please sign in to comment.