Hi everyone,
Currently my Bland-Altman Plots is grouped by Ethnicity using this code.
Could anyone advise me how I could change the code to include all the data but not grouped.
Any help is greatly appreciated
Currently my Bland-Altman Plots is grouped by Ethnicity using this code.
Could anyone advise me how I could change the code to include all the data but not grouped.
Code:
local graphs
levelsof ETHNICITY, local(reps)
foreach r of local reps {
summ difference1 if ETHNICITY == `r'
local mean`r' = r(mean)
local upper`r' = r(mean) + 1.96*`r(sd)'
local lower`r' = r(mean) - 1.96*`r(sd)'
graph twoway scatter difference1 avgclinichomes if ETHNICITY == `r', yline(`mean`r'' `upper`r'' `lower`r'') ///
name(rep`r', replace) title("ETHNICITY = `r'")
local graphs `graphs' rep`r'

Comment