Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save flashton2003/c241f1153a6a9cb76a26f5857fe53976 to your computer and use it in GitHub Desktop.
Save flashton2003/c241f1153a6a9cb76a26f5857fe53976 to your computer and use it in GitHub Desktop.
cd "/Users/benmorton/Documents/Ben's documents/Research/Paper Submission/Current/ISARIC W2/Analysis/Sequencing"
import excel "admissions_data 15032022", sheet ("Sheet1") firstrow clear
sort subjid
save ISARICadata, replace
import excel "discharge_data 15032022", sheet ("Sheet1") firstrow clear
sort subjid
save ISARICddate, replace
use "ISARICadata", clear
merge m:1 subjid using ISARICddate
save ISARICadata, replace
set more off
// Label variables
label variable subjid "Patient ID"
label variable samp_id "Sample ID"
label variable dsstdat "Date of enrolment"
label variable age_estimateyears "Age"
label variable infection_likelihood "Proven or high likelihood of COVID"
label variable fever "Patient has fever"
label variable cough "Patient has cough"
label variable dyspnoea "Patient has difficulty breathing"
label variable ari "Patient has other symptoms suggestive acute respiratory infection"
label variable sex "Patient sex"
label variable pregyn_rptestcd "Patient is pregnant"
label variable cestdat "Date of first symptom"
label variable hostdat "Date of hospital admission"
label variable temp_vsorres "Temperature at enrolment"
label variable hr_vsorres "Heart rate at enrolment"
label variable rr_vsorres "Respiratory rate at enrolment"
label variable sysbp_vsorres "Systolic blood pressure at enrolment"
label variable admission_diabp_vsorres "Diastolic blood pressure at enrolment"
label variable dehydration_vsorres "Patient has severe dehydration"
label variable armcircum_vsorres "Patient arm circumferance"
label variable stercap_vsorres "Patient capillary refill time at enrolment"
label variable oxy_vsorres "Saturations at enrolment"
label variable oxy_vsorresu "Patient receiving oxygen or air at enrolment"
label variable avpu_vsorres "AVPU score at enrolment"
label variable gcs_vsorres "GCS at enrolment"
label variable chroniccard_mhyn "Patient has ischaemic heart disease"
label variable chronicpul_mhyn "Patient has chronic lung disease"
label variable asthma_mhyn "Patient has asthma"
label variable renal_mhyn "Patient has chronic kidney disease"
label variable chronicliver_mhyn "Patient has chronic liver disease"
label variable chronicneu_mhyn "Patient has chronic neurological condition"
label variable diabetiscomp_mhyn "Patient has diabetes"
label variable malnutrition_mhyn "Patient has malnourishment"
label variable currentsmoking_mhyn "Patient is a current smoker"
label variable tuberculosis_mhyn "Patient has TB"
label variable asplenia_mhyn "Patient has asplenia"
label variable malignantneo_mhyn "Patient has malignancy"
label variable aidshiv_mhyn "Patient has HIV"
label variable otherrisktext "Patient has other significant medical issues"
label variable fever_ceoccur_v2 "Patient symptoms include fever"
label variable cough_ceoccur_v2 "Patient symptoms include cough"
label variable coughsput_ceoccur_v2 "Patient symptoms include cough productive of sputum"
label variable coughhb_ceoccur_v2 "Patient symptoms include haemoptysis"
label variable sorethroat_ceoccur_v2 "Patient symptoms include sore throat"
label variable runnynose_ceoccur_v2 "Patient symptoms include runny nose"
label variable wheeze_ceoccur_v2 "Patient symptoms include wheeze"
label variable chestpain_ceoccur_v2 "Patient symptoms include pleuritic pain"
label variable myalgia_ceoccur_v2 "Patient symptoms include myalgia"
label variable jointpain_ceoccur_v2 "Patient symptoms include arthralgia"
label variable fatigue_ceoccur_v2 "Patient symptoms include fatigue"
label variable shortbreath_ceoccur_v2 "Patient symptoms include severe shortness of breath"
label variable walking_ceoccur_v2 "Patient symptoms include unable to walk"
label variable lowerchest_ceoccur_v2 "Patient symptoms include respiratory accessory muscle use"
label variable headache_ceoccur_v2 "Patient symptoms include headache"
label variable confusion_ceoccur_v2 "Patient symptoms include confusion"
label variable seizures_cecoccur_v2 "Patient symptoms include seizures"
label variable abdopain_ceoccur_v2 "Patient symptoms include abdominal pain"
label variable vomit_ceoccur_v2 "Patient symptoms include vomiting"
label variable diarrhoea_ceoccur_v2 "Patient symptoms include diarrhoea"
label variable conjunct_ceoccur_v2 "Patient symptoms include conjunctivitis"
label variable rash_ceoccur_v2 "Patient symptoms include rash"
label variable skinulcers_ceoccur_v2 "Patient symptoms include skin ulcers"
label variable lymp_ceoccur_v2 "Patient symptoms include lymphadenopathy"
label variable bleed_ceoccur_v2 "Patient symptoms include bleeding"
label variable bleed_ceoccur_specify_v2 "What is the bleeding site"
label variable hb_lborres "Haemoglobin"
label variable wbc_lborres "White cell count"
label variable haematocrit_lborres "Haematocrit"
label variable plt_lborres "Platelet count"
label variable mlw_result "MLW COVID test result"
label variable tb_urinary_lam_v2 "Urinary LAM result"
label variable qech_result "QECH COVID test result"
label variable tb_gene_xpert_v2 "Gene Xpert result"
label variable tb_sputum_v2 "TB sputum result"
label variable falciparum_malaria_v2 "Falciprium malaria test result"
label variable dsterm "Patient outcome"
label variable dsstdtc "Date of outcome"
label variable antibiotic_cmyn_v2 "Antibiotics given"
label variable corticost_cmyn_v2 "Steroids given"
label variable hdu_trt_v2 "Admitted to HDU"
label variable icu_trt_v2 "Admitted to ICU"
label variable hdu_admdat_trt_v2 "Date of HDU admission"
label variable xygn_thrpintfc_v2 "Mode of oxygen delivery"
label variable result "SARS-CoV-2 result"
label variable corticost_cmyn "Steroid"
label variable Sequence "Sequencing completed"
* Label values *
label define Sex 1 "male" 2 "female"
label values sex Sex
label define O2 1 "Room air" 2 "Oxygen"
label values oxy_vsorresu O2
label define avpu 1 "Alert" 2 "Confused" 3 "Verbal" 4 "Pain" 5 "Unresponsive"
label values avpu_vsorres avpu
label define yesno 1 "Yes" 2 "No"
label values Sequence chroniccard_mhyn chronicpul_mhyn asthma_mhyn renal_mhyn chronicliver_mhyn chronicneu_mhyn diabetiscomp_mhyn malnutrition_mhyn currentsmoking_mhyn tuberculosis_mhyn asplenia_mhyn malignantneo_mhy infection_likelihood fever cough dyspnoea ari fever_ceoccur_v2 cough_ceoccur_v2 coughsput_ceoccur_v2 coughhb_ceoccur_v2 sorethroat_ceoccur_v2 runnynose_ceoccur_v2 wheeze_ceoccur_v2 chestpain_ceoccur_v2 myalgia_ceoccur_v2 jointpain_ceoccur_v2 fatigue_ceoccur_v2 shortbreath_ceoccur_v2 walking_ceoccur_v2 lowerchest_ceoccur_v2 headache_ceoccur_v2 confusion_ceoccur_v2 seizures_cecoccur_v2 abdopain_ceoccur_v2 vomit_ceoccur_v2 diarrhoea_ceoccur_v2 conjunct_ceoccur_v2 rash_ceoccur_v2 skinulcers_ceoccur_v2 lymp_ceoccur_v2 bleed_ceoccur_v2 corticost_cmyn yesno
label define res 1 "Yes" 2 "No" 99 "Unknown"
label values c19_vacc res
label define hiv 1 "Yes ART" 2 "Yes no ART" 3 "No" 4 "Status unknown"
label values aidshiv_mhyn hiv
label define lam 1 "Positive" 2 "Negative" 3 "Not done"
label values tb_urinary_lam_v2 lam
label define xpert 1 "Postive Rif-S" 2 "Positive Rif-R" 3 "Negative" 4 "Not done"
label values tb_gene_xpert_v2 xpert
label define sputum 1 "Positive" 2 "Negative" 3 "Pending" 4 "Not done"
label values tb_sputum_v2 sputum
label define malaria 1 "Positive" 2 "Negative" 3 "Not done"
label values falciparum_malaria_v2 malaria
label define outcome 1 "Discharge alive" 2 "Death in hospital" 3 "Palliative discharge" 4 "Transfer to another facility" 5 "Continued hospitalisation" 6 "Unknown"
label values dsterm outcome
label define abx 1 "Ceftriaxone" 2 "Amoxicillin" 3 "Cef/Azith" 4 "Cef/Cipro" 5 "Cef/Fluclox" 6 "Cef/Cipro/Doxy" 7 "Augmentin" 8 "RHZE/septrin" 9 "Cef/Amoxicillin" 10 "Azithromycin" 11 "Cef/Metro" 12 "Septrin" 13 "Cef/Doxy" 14 "Cef/Metro/septrin" 15 "Metronidazole" 16 "Cef/Septrin" 17 "Azithromycin/Septrin" 18 "Cef/RHZE/Septrin" 19 "Cef/RHZE" 20 "Cef/metro/erythromycin/chloramphenicol" 21 "Cef/fluconazole/septrin" 22 "Cef/amox/meropenam" 23 "Cef/Metro/RHZE" 24 "Cef/Azith/Septrin" 25 "Cef/Amphotericin" 26 "Amox/metro" 27 "Ciprofloxacin" 28 "Flucloxacillin" 29 "Flucytosine"
label values antibiotic_type_v2 abx
label define steroid 1 "Dexamethasone" 2 "Prednisolone" 3 "Hydrocortisone"
label values corticost_cmdose_v2 steroid
label define SARStest 1 "Postive" 2 "Negative" 3 "Positive Follow Up" 4 "Negative Follow Up" 5 "Indeterminate"
label values result SARStest
label define test 1 "Positive" 0 "Negative" 2 "Unknown"
// Generate variables
gen HIV_status =.
recode HIV_status .=1 if aidshiv_mhyn ==1 | aidshiv_mhyn ==2
recode HIV_status .=0 if aidshiv_mhyn ==3
recode HIV_status .=2 if aidshiv_mhyn ==4
label values HIV_status test
tab HIV_status
gen TBresult =.
recode TBresult .=1 if tb_urinary_lam_v2 ==1 | tb_gene_xpert_v2 ==1 | tb_gene_xpert_v2 ==2 | tb_sputum_v2 ==1
recode TBresult .=0
label values TBresult test
tab TBresult
tab falciparum_malaria_v2
gen malaria =.
recode malaria .=1 if falciparum_malaria_v2 ==1
recode malaria .=2 if falciparum_malaria_v2 ==2 | falciparum_malaria_v2 ==3
label values malaria yesno
gen Survival =.
recode Survival .=1 if dsterm ==2 | dsterm ==3
recode Survival .=0 if dsterm ==1 | dsterm ==4 | dsterm ==5
recode Survival .=2 if dsterm ==6 | dsterm ==.
label define survival 1 "Death" 0 "Survived" 2 "Unknown"
label values Survival survival
tab Survival
// Unknown Survival status dropped from analysis
drop if Survival ==2
gen Betalactam =.
recode Betalactam .=2 if antibiotic_type_v2 ==.
recode Betalactam .=2 if antibiotic_type_v2 ==8 | antibiotic_type_v2 ==10 | antibiotic_type_v2 ==12 | antibiotic_type_v2 ==15 | antibiotic_type_v2 ==17 | antibiotic_type_v2 ==27 | antibiotic_type_v2 ==29
recode Betalactam .=1 if antibiotic_type_v2 !=.
label values Betalactam yesno
tab Betalactam
gen Corticosteroids =.
recode Corticosteroids .=1 if corticost_cmdose_v2 !=.
recode Corticosteroids .=2
label values Corticosteroids yesno
tab Corticosteroids
gen Delay = hostdat - cestdat
gen Symptomstoadmit = Delay if Delay <30 & Delay >-1
tab Symptomstoadmit
gen LOS = dsstdtc - hostdat
gen LOSalive = LOS if Survival==0
gen Timetorecruit1 = dsstdat - hostdat
gen Timetorecruit = Timetorecruit1 if Timetorecruit1 <30 & Timetorecruit1 >-1
tab Timetorecruit
summ Timetorecruit, detail
recode Timetorecruit (min/3=-0) (4/max=1), gen(R72hrs)
tab R72hrs
gen Symptomstorecruit1 = dsstdat - cestdat
gen Symptomstorecruit = Symptomstorecruit1 if Symptomstorecruit1<30 & Symptomstorecruit1>-1
tab Symptomstorecruit
summ Symptomstorecruit, detail
gen vaccinetoadmit1 = dsstdat - dose_date
gen vaccinetoadmit = vaccinetoadmit1 if vaccinetoadmit1 <180 & vaccinetoadmit1 >-1
summ vaccinetoadmit, detail
tab vaccinetoadmit
gen Wave =.
recode Wave .=1 if hostdat < td(30nov2020)
recode Wave .=2 if hostdat < td(01apr2021)
recode Wave .=3 if hostdat > td(31may2021) & hostdat < td(01dec2021)
recode Wave .=4 if hostdat > td(30nov2021)
tab Wave
gen Season =.
recode Season .=1 if hostdat < td(01may2020)
recode Season .=2 if hostdat < td(01nov2020)
recode Season .=1 if hostdat < td(01may2021)
recode Season .=2 if hostdat < td(01nov2021)
recode Season .=1 if hostdat < td(01may2022)
label define season 1 "Winter" 2 "Summer"
label values Season season
tab Season
// Analysis by wave
by Wave, sort: tab Survival if result==1 & Wave!=.
by HIV_status, sort: tab Survival if result==1 & Wave!=.
by Corticosteroids, sort: tab Survival if result==1 & Wave!=.
tab corticost_cmyn
by corticost_cmyn, sort: tab Survival if result==1 & Wave!=.
by avpu, sort: tab Survival if result==1 & Wave!=.
by Wave, sort: summ Symptomstoadmit if result==1 & Wave!=., detail
by Wave, sort: summ Timetorecruit if result==1 & Wave!=., detail
kwallis Symptomstoadmit if result==1, by(Wave)
// 4C score
recode age_estimateyears (min/50=0) (50.1/59=2) (59.1/69=4) (69.1/79=6) (79.1/max=7), gen(Age4C)
gen Sex4C =.
recode Sex4C .=1 if sex==1
recode Sex4C .=0
gen HIV4C =.
recode HIV4C .=1 if aidshiv_mhyn==1 | aidshiv_mhyn==2
recode HIV4C .=0 if aidshiv_mhyn==3 | aidshiv_mhyn==4
recode HIV4C .=0
gen Comorbid = chroniccard_mhyn + chronicpul_mhyn + asthma_mhyn + renal_mhyn + chronicliver_mhyn + chronicneu_mhyn + diabetiscomp_mhyn + malnutrition_mhyn + tuberculosis_mhyn + asplenia_mhyn + malignantneo_mhyn + HIV4C
recode Comorbid (.=0) (min/0.9=0) (1/1.9=1) (2/max=2), gen (Comorbid4C)
recode rr_vsorres (min/20=0) (20.1/29=1) (29.1/max=2), gen(RR4C)
recode oxy_vsorres (min/91.9=2) (92/max=0), gen(SpO24C)
recode gcs_vsorres (min/14=2) (14.1/max=0), gen(GCS4C)
gen ISARICSeverity = Age4C + Sex4C + Comorbid4C + RR4C + SpO24C + GCS4C
by Wave result, sort: summ ISARICSeverity, detail
//Vaccine status
recode c19_vacc (99=2) (.=2) (1=1) (2=2), gen(vaccine)
label values vaccine yesno
tab vaccine
// UVA score calculation
gen UVAtemp =.
recode UVAtemp .=2 if temp_vsorres <36.0
recode UVAtemp .=0
gen UVAHR =.
recode UVAHR .=1 if hr_vsorres >119
recode UVAHR .=0
gen UVARR =.
recode UVARR .=1 if rr_vsorres >29
recode UVARR .=0
gen UVASBP =.
recode UVASBP .=1 if sysbp_vsorres <90
recode UVASBP .=0
gen UVASpO2 =.
recode UVASpO2 .=2 if oxy_vsorres <92
recode UVASpO2 .=0
gen UVAGCS =.
recode UVAGCS .=4 if gcs_vsorres <15
recode UVAGCS .=0
gen UVAHIV =.
recode UVAHIV .=2 if HIV_status==1
recode UVAHIV .=0
gen UVA = UVAtemp + UVAHR + UVARR + UVASBP + UVASpO2 + UVAGCS + UVAHIV
tab UVA
// Wave analysis
// Demographics
tabulate Wave sex if result==1 & Wave!=., exact
by Wave, sort: summ age_estimateyears if result==1 & Wave!=., detail
kwallis age_estimateyears if result==1 & Wave!=., by(Wave)
by Wave, sort: summ Symptomstoadmit if result==1 & Wave!=., detail
kwallis Symptomstoadmit if result==1 & Wave!=., by(Wave)
by Wave, sort: summ Timetorecruit if result==1 & Wave!=., detail
kwallis Timetorecruit if result==1 & Wave!=., by(Wave)
tabulate Wave HIV4C if result==1 & Wave!=., exact
tabulate Wave TBresult if result==1 & Wave!=., exact
tabulate Wave malaria if result==1 & Wave!=., exact
tabulate Wave chroniccard_mhyn if result==1 & Wave!=., exact
tabulate Wave diabetiscomp_mhyn if result==1 & Wave!=., exact
tabulate Wave oxy_vsorresu if result==1 & Wave!=., exact
tabulate Wave Betalactam if result==1 & Wave!=., exact
tabulate Wave Corticosteroids if result==1 & Wave!=., exact
tabulate Wave vaccine if result==1 & Wave!=., exact
//Clinical severity
by Wave, sort: summ ISARICSeverity if result==1 & Wave!=., detail
kwallis ISARICSeverity if result==1 & Wave!=., by(Wave)
by Wave, sort: summ UVA if result==1 & Wave!=., detail
kwallis UVA if result==1 & Wave!=., by(Wave)
by Wave, sort: summ LOSalive if result==1 & Wave!=., detail
kwallis LOSalive if result==1 & Wave!=., by(Wave)
tabulate Wave Survival if result==1 & Wave!=., exact
tabulate vaccine Survival if result==1 & Wave!=., exact
recode Survival (1=1) (0=0) if result==1 & Wave!=., generate(PCRmort)
tab PCRmort
gen SpO2 =.
recode SpO2 .=1 if oxy_vsorres >95
recode SpO2 .=2 if oxy_vsorres >92
recode SpO2 .=3 if oxy_vsorres >87
recode SpO2 .=4 if oxy_vsorres >0
label define sats 1 "≥96" 2 "93-95" 3 "88-92" 4 "≤87"
label values SpO2 sats
tab SpO2
// Sequencing
tabulate Wave sex if result==1 & Sequence==1 & Wave!=., row chi2
by Wave, sort: summ age_estimateyears if result==1 & Sequence==1 & Wave!=., detail
kwallis age_estimateyears if result==1 & Sequence==1 & Wave!=., by(Wave)
by Wave, sort: summ Symptomstoadmit if result==1 & Sequence==1 & Wave!=., detail
kwallis Symptomstoadmit if result==1 & Sequence==1 & Wave!=., by(Wave)
by Wave, sort: summ Timetorecruit if result==1 & Sequence==1 & Wave!=., detail
kwallis Timetorecruit if result==1 & Sequence==1 & Wave!=., by(Wave)
tabulate Wave HIV4C if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave TBresult if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave malaria if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave chroniccard_mhyn if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave diabetiscomp_mhyn if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave oxy_vsorresu if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave Betalactam if result==1 & Sequence==1 & Wave!=., row chi2
tabulate Wave Corticosteroids if result==1 & Sequence==1 & Wave!=., row chi
by Wave, sort: summ ISARICSeverity if result==1 & Sequence==1 & Wave!=., detail
kwallis ISARICSeverity if result==1 & Sequence==1 & Wave!=., by(Wave)
by Wave, sort: summ UVA if result==1 & Sequence==1 & Wave!=., detail
kwallis UVA if result==1 & Sequence==1 & Wave!=., by(Wave)
by Wave, sort: summ LOSalive if result==1 & Sequence==1 & Wave!=., detail
kwallis LOSalive if result==1 & Sequence==1 & Wave!=., by(Wave)
tabulate Wave Survival if result==1 & Sequence==1 & Wave!=., row chi2
tabulate vaccine Survival if result==1 & Sequence==1 & Wave!=., row chi2
//Presentation symptoms
tabulate Wave fever_ceoccur_v2 if result==1, row chi2
tabulate Wave cough_ceoccur_v2 if result==1, row chi2
tabulate Wave coughsput_ceoccur_v2 if result==1, row chi2
tabulate Wave coughhb_ceoccur_v2 if result==1, row chi2
tabulate Wave sorethroat_ceoccur_v2 if result==1, row chi2
tabulate Wave runnynose_ceoccur_v2 if result==1, row chi2
tabulate Wave chestpain_ceoccur_v2 if result==1, row chi2
tabulate Wave myalgia_ceoccur_v2 if result==1, row chi2
tabulate Wave jointpain_ceoccur_v2 if result==1, row chi2
tabulate Wave fatigue_ceoccur_v2 if result==1, row chi2
tabulate Wave shortbreath_ceoccur_v2 if result==1, row chi2
tabulate Wave lowerchest_ceoccur_v2 if result==1, row chi2
tabulate Wave headache_ceoccur_v2 if result==1, row chi2
tabulate Wave confusion_ceoccur_v2 if result==1, row chi2
tabulate Wave seizures_cecoccur_v2 if result==1, row chi2
tabulate Wave abdopain_ceoccur_v2 if result==1, row chi2
tabulate Wave vomit_ceoccur_v2 if result==1, row chi2
tabulate Wave diarrhoea_ceoccur_v2 if result==1, row chi2
tabulate Wave conjunct_ceoccur_v2 if result==1, row chi2
tabulate Wave rash_ceoccur_v2 if result==1, row chi2
tabulate Wave skinulcers_ceoccur_v2 if result==1, row chi2
tabulate Wave lymp_ceoccur_v2 if result==1, row chi2
tabulate Wave bleed_ceoccur_v2 if result==1, row chi2
// Mortality univariate and multivariate analysis
logistic PCRmort i.Wave
logistic PCRmort ib2.Season
logistic PCRmort ib2.vaccine
logistic PCRmort age_estimateyears
logistic PCRmort ib2.sex
logistic PCRmort i.HIV_status
logistic PCRmort ib2.chroniccard_mhyn
logistic PCRmort ib2.diabetiscomp_mhyn
logistic PCRmort Symptomstoadmit
logistic PCRmort rr_vsorres
logistic PCRmort i.SpO2
logistic PCRmort i.Wave ib2.Season ib2.vaccine age_estimateyears ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn Symptomstoadmit rr_vsorres i.SpO2
//Continuous to categorical variables
summ age_estimateyears if result==1, detail
recode age_estimateyears (min/29.9=0) (30/39.9=1) (40/49.9=2) (50/59.9=3) (60/69.9=4) (70/max=5), gen(Age)
tab Age
label define age 0 "<30" 1 "30-39" 2 "40-49" 3 "50-59" 4 "60-69" 5 "≥70"
label values Age age
summ rr_vsorres if result==1, detail
recode rr_vsorres (min/19.9=0) (20/24.9=1) (25/29.9=2) (30/max=3), gen(RR)
label define rr 0 "<20" 1 "20-24" 2 "25-29" 3 "≥30"
label values RR rr
tab RR
summ Symptomstoadmit if result==1, detail
recode Symptomstoadmit (min/3=0) (4/6=1) (7/9=2) (10/max=3), gen(DD)
label define dd 0 "<4" 1 "4-6" 2 "7-9" 3 "≥10"
label values DD dd
tab DD
logistic PCRmort i.Age
logistic PCRmort i.RR
logistic PCRmort i.DD
logistic PCRmort i.Wave ib2.Season ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2
//Remove season as colinear with Wave
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2
//Likelihood ratio test to see if Wave adds to mulivariate model
logistic PCRmort ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2
estimates store m1
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2
estimates store m2
lrtest m1 m2
//Likelihood ratio test to see if Wave adds to univariate model
logistic PCRmort
estimates store m1
logistic PCRmort i.Wave
estimates store m2
lrtest m1 m2
// Sensitivity removing wave from multivariable model
logistic PCRmort ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2
// Symptoms to admit continuous variable
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn Symptomstoadmit i.RR i.SpO2
// Likelihood ratio test to see if Wave adds to multivariate model (symptoms to admit as continuous)
logistic PCRmort ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn Symptomstoadmit i.RR i.SpO2
estimates store m1
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn Symptomstoadmit i.RR i.SpO2
estimates store m2
lrtest m1 m2
// Sensitivity analysis removing patients who did not require oxygen
tab oxy_vsorresu if result==1
logistic PCRmort i.Wave if oxy_vsorresu ==2
logistic PCRmort ib2.vaccine if oxy_vsorresu ==2
logistic PCRmort i.Age if oxy_vsorresu ==2
logistic PCRmort ib2.sex if oxy_vsorresu ==2
logistic PCRmort i.HIV_status if oxy_vsorresu ==2
logistic PCRmort ib2.chroniccard_mhyn if oxy_vsorresu ==2
logistic PCRmort ib2.diabetiscomp_mhyn if oxy_vsorresu ==2
logistic PCRmort i.DD if oxy_vsorresu ==2
logistic PCRmort i.RR if oxy_vsorresu ==2
logistic PCRmort i.SpO2 if oxy_vsorresu ==2
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2 if oxy_vsorresu ==2
// Likelihood ratio test to see if Wave adds to the model
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn i.DD i.RR i.SpO2 if oxy_vsorresu ==2
estimates store m1
logistic PCRmort i.Wave ib2.vaccine i.Age ib2.sex i.HIV_status ib2.chroniccard_mhyn ib2.diabetiscomp_mhyn Symptomstoadmit i.RR i.SpO2 if oxy_vsorresu ==2
estimates store m2
lrtest m1 m2
tab oxy_vsorresu PCRmort if result ==1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment