Hey everyone,
I’m interested in calculating and plotting predicted probabilities for 30-day survival using marginsplot in Stata, but I need to adjust my standard errors to account for non-nested clusters.
I’m working with generalized estimating equations (xtgee) to examine the association between ambulance case volume for a specific medical issue and patient 30-day survival. I need to account for correlations within ambulance units (1-3 persons in the same ambulance treating the same patient) and within ambulance personnel (the same person responding to 0-40 cases per year).
I’m using a method based on the approach described by Miglioretti & Heagerty (2007),(https://academic.oup.com/aje/article...5/4/453/109343). which allows to account for two non-nested clusters:
Data example:
Is it possible to change the variance matrix in marginsplot or can I produce the plot manually somehow?
Thanks in advance!
I’m interested in calculating and plotting predicted probabilities for 30-day survival using marginsplot in Stata, but I need to adjust my standard errors to account for non-nested clusters.
I’m working with generalized estimating equations (xtgee) to examine the association between ambulance case volume for a specific medical issue and patient 30-day survival. I need to account for correlations within ambulance units (1-3 persons in the same ambulance treating the same patient) and within ambulance personnel (the same person responding to 0-40 cases per year).
I’m using a method based on the approach described by Miglioretti & Heagerty (2007),(https://academic.oup.com/aje/article...5/4/453/109343). which allows to account for two non-nested clusters:
- C1ID: Identifies observations belonging to the same ambulance.
- C2ID: Identifies observations belonging to the same ambulance personnel.
- C1C2ID: Identifies observations belonging to both the same ambulance and ambulance personnel.
Code:
xtgee survival_30_days casevol_12month, family(bin) link(logit) corr(ind) robust i(C1ID) matrix V1= e(V) xtgee survival_30_days casevol_12month, family(bin) link(logit) corr(ind) robust i(C2ID) matrix V2=e(V) xtgee survival_30_days casevol_12month, family(bin) link(logit) corr(ind) robust i(C1C2ID) matrix V3=e(V) matrix V = V1 + V2 - V3
Data example:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(patient_age patient_sex) str36 personnel_id str31 unit_id float(casevol_12month survival_30_days) 72 1 "1" "Ambulance 1" 13 1 72 1 "2" "Ambulance 1" 1 1 78 1 "2" "Ambulance2" 5 0 64 1 "3" "Ambulance12" 7 0 64 1 "4" "Ambulance12" 4 0 73 1 "2" "Ambulance21" 6 0 73 1 "5" "Ambulance21" 0 0 72 1 "7" "Ambulance25" 13 1 64 1 "8" "Ambulance20" 10 0 78 1 "9" "Ambulance31" 15 0 end label values patient_sex sexlab label def sexlab 1 "Male", modify label values survival_30_days yes1no0_ label def yes1no0_ 0 "No", modify label def yes1no0_ 1 "Yes", modify label var patient_age "Patient's age" label var patient_sex "Patient's sex" label var survival_30_days "30-day survival"
Is it possible to change the variance matrix in marginsplot or can I produce the plot manually somehow?
Thanks in advance!
Comment