Skip to content

Commit 689bf42

Browse files
authored
Merge pull request #129 from UCL/Loveleen
Update hiv_synthesis.sas
2 parents 557e20b + dee272c commit 689bf42

File tree

1 file changed

+25
-38
lines changed

1 file changed

+25
-38
lines changed

hiv_synthesis.sas

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ prob_prep_restart=1.00; * set to 1 given we have rate_test_restartprep; *Probabi
419419
prob_prep_visit_counsel=0; *Probability of PrEP adherence counselling happening at drug pick-up;
420420
prob_prep_restart_choice=0.10; * probability of restarting PrEP after discontinuation even when newp>1;
421421
* dependent_on_time_step_length ;
422-
prepuptake_sw=0.50; *Probability of PrEP uptake if eligible for female sex workers;
423422
prepuptake_pop=0.20; **Probability of PrEP uptake if eligible for general population;
424423
pop_wide_tld_prob_egfr=0.5; * probability per 3 months of getting egfr test when pop_wide_tld_prep=1 when indicated (annually);
425424
* dependent_on_time_step_length ;
@@ -725,8 +724,8 @@ p_neph_stops_after_ten = 0.1;
725724
if e >= 0.66 then effect_sw_prog_adh=1;
726725
* effect_sw_prog_lossdiag; e=uniform(0); if e < 0.33 then effect_sw_prog_lossdiag=0.80; if 0.33 <= e < 0.66 then effect_sw_prog_lossdiag=0.60;
727726
if e >= 0.66 then effect_sw_prog_lossdiag=0.40;
728-
* effect_sw_prog_prep; e=uniform(0); if e < 0.33 then effect_sw_prog_prep=0.60; if 0.33 <= e < 0.66 then effect_sw_prog_prep=0.75;
729-
if e >= 0.66 then effect_sw_prog_prep=0.90;
727+
* effect_sw_prog_prep; e=uniform(0);if e < 0.50 then effect_sw_prog_prep=0.95; if e >= 0.50 then effect_sw_prog_prep=0.80;
728+
730729

731730
* tb_base_prob_diag_l; e=uniform(0); if e < 0.333 then tb_base_prob_diag_l=0.25; if 0.333 <= e < 0.666 then tb_base_prob_diag_l=0.50;
732731
if e >= 0.666 then tb_base_prob_diag_l=0.75;
@@ -765,9 +764,9 @@ p_neph_stops_after_ten = 0.1;
765764
* prob_prep_restart_choice; r=uniform(0); if r < 0.33 then prob_prep_restart_choice=0.05; if 0.33 <= r < 0.67 then prob_prep_restart_choice=0.10;
766765
if 0.67 <= r then prob_prep_restart_choice=0.20;
767766
* dependent_on_time_step_length ;
768-
769-
* prepuptake_sw; r=uniform(0); prepuptake_sw=0.5; if r > 0.8 then prepuptake_sw =0.10; if r < 0.2 then prepuptake_sw = 0.80;
767+
770768
* prepuptake_pop; r=uniform(0); prepuptake_pop=0.2; if r > 0.8 then prepuptake_pop =0.10; if r < 0.2 then prepuptake_pop = 0.5 ;
769+
* add_prepuptake_sw; add_prepuptake_sw=0; ***this may be sampled at a later date;
771770

772771
* note there are three parameters that affect use of prep besides the prep_strategy - prob_prep_b is prob of starting if prep_elig=1 and tested=1
773772
and prep_willing = 1 - a person cannot be prep_elig=1 if hard_reach=1 - a person prep_elig=1 will only actually have a chance of starting prep
@@ -1612,7 +1611,6 @@ eff_sw_higher_int = sw_higher_int;
16121611
eff_prob_sw_lower_adh = prob_sw_lower_adh;
16131612
eff_sw_higher_prob_loss_at_diag = sw_higher_prob_loss_at_diag;
16141613
sw_program_visit=0;
1615-
eff_prepuptake_sw=prepuptake_sw;
16161614

16171615
* na defines a "non-adherent person" - not sure if this is reasonable structure for non adherence;
16181616

@@ -1806,11 +1804,7 @@ if adh_pattern_prep=4 then adhav_pr = adhav*0.50;
18061804

18071805

18081806
* willingness to take prep if offered;
1809-
r1=uniform(0); prep_willing_pop = 0; if r1 < prepuptake_pop then prep_willing_pop =1;
1810-
if gender=2 then do;
1811-
r2=uniform(0); prep_willing_sw = prep_willing_pop;
1812-
if prep_willing_pop=0 and r2 < (prepuptake_sw-prepuptake_pop)/(1-prepuptake_pop) then prep_willing_sw =1;
1813-
end;
1807+
r1=uniform(0); prep_willing = 0; if r1 < prepuptake_pop then prep_willing =1;
18141808

18151809
hiv=0;
18161810
nip=0;
@@ -2037,8 +2031,7 @@ if sw_program_visit=0 then do; e=uniform(0);
20372031
eff_sw_higher_int = sw_higher_int * effect_sw_prog_int;
20382032
eff_prob_sw_lower_adh = prob_sw_lower_adh / effect_sw_prog_adh ;
20392033
eff_sw_higher_prob_loss_at_diag = sw_higher_prob_loss_at_diag * effect_sw_prog_lossdiag;
2040-
eff_prepuptake_sw=effect_sw_prog_prep;
2041-
s= uniform(0); if s < eff_prepuptake_sw and prep_willing_sw = 0 then prep_willing_sw = 1;
2034+
s= uniform(0); if s < effect_sw_prog_prep and prep_willing = 0 then prep_willing = 1;
20422035
end;
20432036
end;
20442037
end;
@@ -2051,7 +2044,6 @@ else if sw_program_visit=1 then do; e=uniform(0);
20512044
eff_sw_higher_int = sw_higher_int;
20522045
eff_prob_sw_lower_adh = prob_sw_lower_adh;
20532046
eff_sw_higher_prob_loss_at_diag = sw_higher_prob_loss_at_diag ;
2054-
eff_prepuptake_sw=prepuptake_sw;
20552047
end;
20562048

20572049
end;
@@ -2157,17 +2149,13 @@ if higher_future_prep_cov=1 then do;
21572149
eff_prob_prep_restart_choice = round(eff_prob_prep_restart_choice, 0.01);
21582150
end;
21592151

2160-
* incr_prepuptake_sw_2020;
2161-
incr_prepuptake_sw_2020 = 0;
2162-
if _u34 < 0.95 then do; incr_prepuptake_sw_2020 = 1;
2163-
r= uniform(0); if r < 0.95 and prep_willing_sw = 0 then prep_willing_sw = 1;
2164-
end;
2152+
21652153

21662154
* incr_prepuptake_pop_2020;
21672155
incr_prepuptake_pop_2020 = 0;
21682156
if _u36 < 0.95 then do;
21692157
incr_prepuptake_pop_2020 = 1;
2170-
r= uniform(0); if r < 0.8 and prep_willing_pop = 0 then prep_willing_pop = 1;
2158+
r= uniform(0); if r < 0.8 and prep_willing = 0 then prep_willing = 1;
21712159
end;
21722160

21732161
* prep_strategy;
@@ -3313,6 +3301,10 @@ if gender = 2 and sw_tm1 = 0 then do;
33133301
if 20 <= age < 25 and life_sex_risk = 3 and e < base_rate_sw*rr_sw_life_sex_risk_3*sqrt(rred_rc) then sw=1;
33143302
if 25 <= age < 35 and life_sex_risk = 3 and e < base_rate_sw*rr_sw_age_2534*rr_sw_life_sex_risk_3*sqrt(rred_rc) then sw=1;
33153303
if 35 <= age < 50 and life_sex_risk = 3 and e < base_rate_sw*rr_sw_age_3549*rr_sw_life_sex_risk_3*sqrt(rred_rc) then sw=1;
3304+
3305+
if sw=1 then do; r=uniform(0);if prep_willing=0 and r < add_prepuptake_sw then prep_willing=1;end;
3306+
***currently SW are no more likely to be willing to take prep than gen pop;
3307+
33163308
end;
33173309

33183310
if ever_sw = 1 then do; * dependent_on_time_step_length ;
@@ -3331,6 +3323,7 @@ end;
33313323
end;
33323324

33333325

3326+
33343327
*initial distribution of newp for sw (need to define tm1 here in order to define number of current partners below);
33353328
if t ge 2 and sw_tm1 ne 1 and sw=1 then do;
33363329
e=uniform(0);
@@ -4069,7 +4062,7 @@ and ((testing_disrup_covid ne 1 or covid_disrup_affected ne 1 )) then do;
40694062
available with roll-out and interest of PrEP
40704063
do not differentiate the probabilty of testing whether they have a short-term or long-term partner;
40714064

4072-
if prep_ever ne 1 and tested ne 1 and prep_elig=1 and (prep_willing_pop=1 or (sw=1 and prep_willing_sw=1 )) then do;
4065+
if prep_ever ne 1 and tested ne 1 and prep_elig=1 and prep_willing=1 then do;
40734066
a=uniform(0); if a < eff_rate_test_startprep then do;
40744067
tested=1;ever_tested=1;testfor_prep=1;dt_last_test=caldate{t};np_lasttest=0;
40754068
end;
@@ -4133,18 +4126,12 @@ if t ge 4 and caldate{t} ge date_prep_intro and registd ne 1 and prep_elig=1 the
41334126
*it was tested_tm1=1 and hiv_tm1=0. Now changed to tested=1 and commented out hiv_tm1=0 because
41344127
we want people who are false negative to also start PrEP, this is the reason why hiv=0 is now commented out;
41354128
if prep_ever ne 1 and tested=1 and (hiv=0 or (hiv=1 and unisensprep > sens_vct)) then do;
4136-
if sw = 1 then do;
4137-
if prep_willing_sw=1 then do;
4138-
if testfor_prep = 1 then do; prep =1; prep_ever=1; continuous_prep_use=0.25; dt_prep_s=caldate{t}; dt_prep_e=caldate{t};end;
4139-
else if testfor_prep ne 1 then do;r=uniform(0); if r < prob_prep_b then do; prep =1; prep_ever=1; dt_prep_s=caldate{t}; dt_prep_e=caldate{t};end; end;
4140-
end;
4141-
end;
4142-
else if sw ne 1 then do;
4143-
if prep_willing_pop=1 then do;
4129+
4130+
if prep_willing=1 then do;
41444131
if testfor_prep = 1 then do;prep =1; prep_ever=1; continuous_prep_use=0.25; dt_prep_s=caldate{t}; dt_prep_e=caldate{t};end;
41454132
else if testfor_prep ne 1 then do;r=uniform(0); if r < prob_prep_b then do; prep =1; prep_ever=1; dt_prep_s=caldate{t}; dt_prep_e=caldate{t};end; end;
41464133
end;
4147-
end;
4134+
41484135
started_prep_hiv_test_sens=0;if prep =1 and (hiv=1 and unisensprep > sens_vct) then do; started_prep_hiv_test_sens=1;started_prep_hiv_test_sens_e=1;end;
41494136
end;
41504137
* continuing PrEP;
@@ -4202,10 +4189,10 @@ if pop_wide_tld=1 and prep=1 then pop_wide_tld_prep=1;
42024189
if pop_wide_tld = 1 and registd ne 1 and ( prep_elig = 1 or ( ever_newp = 1 and ever_tested ne 1 ) ) then do;
42034190

42044191
if prep_ever ne 1 then do; * dependent_on_time_step_length;
4205-
r=uniform(0); if (prep_willing_pop=1 or (sw=1 and prep_willing_sw=1 )) and r < prob_prep_pop_wide_tld then do ;
4192+
r=uniform(0); if prep_willing=1 and r < prob_prep_pop_wide_tld then do ;
42064193

42074194
* ts1m ; * replace line above with this:
4208-
* r=uniform(0); * if (prep_willing_pop=1 or (sw=1 and prep_willing_sw=1 )) and r < ( 1 - (1 - prob_prep_pop_wide_tld)**(1/3) ) then do ;
4195+
* r=uniform(0); * if prep_willing=1 and r < ( 1 - (1 - prob_prep_pop_wide_tld)**(1/3) ) then do ;
42094196

42104197
prep =1; pop_wide_tld_prep=1; prep_ever=1; dt_prep_s=caldate{t}; dt_prep_e=caldate{t};
42114198
end;
@@ -14295,7 +14282,7 @@ if 15 <= age < 65 and (death = . or caldate&j = death ) then do;
1429514282
s_onprep_12_i_prep_no_r + onprep_12_i_prep_no_r ; s_onprep_18_i_prep_no_r + onprep_18_i_prep_no_r ; s_prepinfect_rm_p + prepinfect_rm_p ;
1429614283
s_prepinfect_m184m_p + prepinfect_m184m_p ; s_prepinfect_k65m_p + prepinfect_k65m_p ; s_prepinfect_tam_p + prepinfect_tam_p ;
1429714284
s_prepinfect_rtm + prepinfect_rtm ; s_prepinfect_k65m + prepinfect_k65m ; s_prepinfect_m184m + prepinfect_m184m ; s_prepinfect_tam + prepinfect_tam ;
14298-
s_prep_willing_pop + prep_willing_pop ; s_prep_willing_sw + prep_willing_sw ; s_stop_prep_choice + stop_prep_choice ;
14285+
s_prep_willing + prep_willing ; s_stop_prep_choice + stop_prep_choice ;
1429914286
s_started_prep_hiv_test_sens + started_prep_hiv_test_sens ; s_cur_res_prep_drug + cur_res_prep_drug ;
1430014287
s_started_prep_hiv_test_sens_e + started_prep_hiv_test_sens_e ; s_started_prep_in_primary_e + started_prep_in_primary_e ;
1430114288
s_cur_res_ten + cur_res_ten ; s_cur_res_3tc + cur_res_3tc ; s_i_65m + i_65m ; s_cur_res_efa + cur_res_efa ;
@@ -14326,7 +14313,7 @@ if 15 <= age < 65 and (death = . or caldate&j = death ) then do;
1432614313
s_tested_4p_m4049_ + tested_4p_m4049_ ; s_tested_4p_m5064_ + tested_4p_m5064_ ; s_tested_4p_w1549_ + tested_4p_w1549_ ;
1432714314
s_tested_4p_w1519_ + tested_4p_w1519_ ; s_tested_4p_w2024_ + tested_4p_w2024_ ; s_tested_4p_w2529_ + tested_4p_w2529_ ;
1432814315
s_tested_4p_w3039_ + tested_4p_w3039_ ; s_tested_4p_w4049_ + tested_4p_w4049_ ; s_tested_4p_w5064_ + tested_4p_w5064_ ;
14329-
s_tested_4p_sw + tested_4p_sw ; s_tested_sw + tested_sw
14316+
s_tested_4p_sw + tested_4p_sw ; s_tested_sw + tested_sw;
1433014317
s_ever_tested_m1549_ + ever_tested_m1549_ ; s_ever_tested_m1519_ + ever_tested_m1519_ ;
1433114318
s_ever_tested_m2024_ + ever_tested_m2024_ ; s_ever_tested_m2529_ + ever_tested_m2529_ ; s_ever_tested_m3034_ + ever_tested_m3034_ ;
1433214319
s_ever_tested_m3539_ + ever_tested_m3539_ ; s_ever_tested_m4044_ + ever_tested_m4044_ ; s_ever_tested_m4549_ + ever_tested_m4549_ ;
@@ -15582,7 +15569,7 @@ s_infected_prep_source_prep_r s_prepinfect_prep_r s_prepinfect_prep_r_p s
1558215569
s_started_prep_in_primary s_tot_yrs_prep s_onprep_3_i_prep_no_r s_onprep_6_i_prep_no_r s_onprep_9_i_prep_no_r
1558315570
s_onprep_12_i_prep_no_r s_onprep_18_i_prep_no_r s_prepinfect_rm_p s_prepinfect_m184m_p s_prepinfect_k65m_p
1558415571
s_prepinfect_tam_p s_prepinfect_rtm s_prepinfect_k65m s_prepinfect_m184m s_prepinfect_tam
15585-
s_prep_willing_pop s_prep_willing_sw s_stop_prep_choice s_started_prep_hiv_test_sens
15572+
s_prep_willing s_stop_prep_choice s_started_prep_hiv_test_sens
1558615573
s_cur_res_prep_drug s_started_prep_hiv_test_sens_e s_started_prep_in_primary_e
1558715574
s_cur_res_ten s_cur_res_3tc s_i_65m s_cur_res_efa
1558815575
s_cur_res_ten_vlg1000 s_cur_res_3tc_vlg1000 s_cur_res_efa_vlg1000 s_ever_hiv1_prep
@@ -16399,7 +16386,7 @@ s_infected_prep_source_prep_r s_prepinfect_prep_r s_prepinfect_prep_r_p s
1639916386
s_started_prep_in_primary s_tot_yrs_prep s_onprep_3_i_prep_no_r s_onprep_6_i_prep_no_r s_onprep_9_i_prep_no_r
1640016387
s_onprep_12_i_prep_no_r s_onprep_18_i_prep_no_r s_prepinfect_rm_p s_prepinfect_m184m_p s_prepinfect_k65m_p
1640116388
s_prepinfect_tam_p s_prepinfect_rtm s_prepinfect_k65m s_prepinfect_m184m s_prepinfect_tam
16402-
s_prep_willing_pop s_prep_willing_sw s_stop_prep_choice s_started_prep_hiv_test_sens
16389+
s_prep_willing s_stop_prep_choice s_started_prep_hiv_test_sens
1640316390
s_cur_res_prep_drug s_started_prep_hiv_test_sens_e s_started_prep_in_primary_e
1640416391
s_cur_res_ten s_cur_res_3tc s_i_65m s_cur_res_efa
1640516392
s_cur_res_ten_vlg1000 s_cur_res_3tc_vlg1000 s_cur_res_efa_vlg1000 s_ever_hiv1_prep
@@ -17016,7 +17003,7 @@ end;
1701617003

1701717004
data x; set cum_l1;
1701817005

17019-
file "/home/rmjxxx/Scratch/_output_base_19_02_21_&dataset_id";
17006+
file "/home/rmjxxx/Scratch/_output_base_22_02_21_&dataset_id";
1702017007

1702117008
put
1702217009

@@ -17226,7 +17213,7 @@ s_infected_prep_source_prep_r s_prepinfect_prep_r s_prepinfect_prep_r_p s
1722617213
s_started_prep_in_primary s_tot_yrs_prep s_onprep_3_i_prep_no_r s_onprep_6_i_prep_no_r s_onprep_9_i_prep_no_r
1722717214
s_onprep_12_i_prep_no_r s_onprep_18_i_prep_no_r s_prepinfect_rm_p s_prepinfect_m184m_p s_prepinfect_k65m_p
1722817215
s_prepinfect_tam_p s_prepinfect_rtm s_prepinfect_k65m s_prepinfect_m184m s_prepinfect_tam
17229-
s_prep_willing_pop s_prep_willing_sw s_stop_prep_choice s_started_prep_hiv_test_sens
17216+
s_prep_willing s_stop_prep_choice s_started_prep_hiv_test_sens
1723017217
s_cur_res_prep_drug s_started_prep_hiv_test_sens_e s_started_prep_in_primary_e
1723117218
s_cur_res_ten s_cur_res_3tc s_i_65m s_cur_res_efa
1723217219
s_cur_res_ten_vlg1000 s_cur_res_3tc_vlg1000 s_cur_res_efa_vlg1000 s_ever_hiv1_prep

0 commit comments

Comments
 (0)