******************************************************************************** * * Do-file: Key analyses.do * Programmed by: Elizabeth Williamson, * (original: 1/11/2017, edited for sharing 24/02/2021) * (elizabeth.williamson@lshtm.ac.uk) * * Data used: SW_primary_vas.dta * SW_patient_flow.dta * SW_secondary_questionnaire * * Data created: None * * Other output: Models on screen. * * ******************************************************************************** * * Purpose: This do-file perform the key analyses of the StatinWISE * trial using the shared data. * ******************************************************************************** clear all version 15 set more off * Change directory to where data is stored ****************************************************** * Primary outcome (daily VAS muscle symptom score) * ****************************************************** * Open data use "SW_primary_vas.dta", clear noi count * Add patient marker indicating who to include in the primary analysis merge m:1 share_pid using "SW_patient_flow", /// assert(match using) keep(match) /// nogen keepusing(share_pid include_primary) noi count * Delete individuals who do not have 1+ VAS on statin and 1+ VAS on placebo keep if include_primary==1 drop include_primary * Time variable for mixed model (days since first tablet) gen day = (period-1)*56+daynumber /* Primary analysis */ * Mixed model mixed vas_primary i.treat || share_pid: treat, ml /// residuals(ar 1, t(day)) vce(robust) covariance(unstructured) **************************************** * Secondary outcomes (questionnaire) * **************************************** /* Binary outcomes */ use "SW_secondary_questionnaire", clear * Any muscle symptoms meqrlogit muscle_symptoms i.treat /// if itt_muscle_symptoms==1 /// || share_pid: treat, /// covariance(unstructured) level(99) meqrlogit, or level(99) * Any muscle symptoms not attributed to other things meqrlogit muscle_symptoms_restrict i.treat /// if itt_muscle_symptoms_restrict==1 /// || share_pid: treat, /// covariance(independent) level(99) meqrlogit, or level(99) /* VAS scales */ foreach var in vas_activity vas_mood vas_walk vas_work /// vas_relations vas_sleep vas_enjoy { if "`var'"=="vas_relations" { local add = "technique(dfp)" } else { local add = " " } mixed `var' i.treat || share_pid: treat /// if itt_`var'==1, ml vce(robust) covariance(unstructured) /// emiterate(200) level(99) `add' }