#### omarokasha

##### New Member
I am working on a survey data, and found a previous report which had the following graph and table in it, I have no idea what commands were used to produce them as I need to produce similar report....the survey was on proportion of antibiotics used in different hospitals in Egypt..so the table shows name of the hospital, proportion using antibiotics, lower limit and upper limit (confidence interval) and rank, which are all showed on the graph
:
here is the table

By omarokasha123 at 2011-10-14
(Table. Percentage of patients treated with antibiotics with 95% confidence intervals for Alexandria university hospitals in point prevalence survey)
By omarokasha123 at 2011-10-14[/IMG]

thanks a lot

Last edited:

#### omarokasha

##### New Member
ok I figured how to plot the graph:
collapse (count) n= NoAbsC (mean) mean= NoAbsC (sd) sd= NoAbsC, by( HospitalName)
sort HospitalName
generate se=sd/sqrt(n)
generate ci1=mean+(1.96*se)
generate ci2=mean-(1.96*se)
twoway (scatter mean HospitalName, clcolor(red)) (rcap ci1 ci2 HospitalName)

still unable to figure how the table was made

#### noetsi

##### No cake for spunky
I am not sure I understand the question. They are simply drawing the confidence intervals provided in the table around the means provided there? Do you mean where they got the data?

#### omarokasha

##### New Member
I am not sure I understand the question. They are simply drawing the confidence intervals provided in the table around the means provided there? Do you mean where they got the data?
I am sorry I know it seems very obvious, but I can not simply create a table like the one I posted, I already have the data, I want to simply make an identical table with proportion, LL, UL and ranking. So I tried this line: svy linearized : tabulate variable1 variable2, row ci obs percent pearson where variable1 is the hospital names and variable2 is the binary variable (Yes/No) indicating Antibiotic used. The resulting table looks quite the same but with two problems: first there is no rank, and second the percentage and confidence limits are given in one cell all together..not like three different columns.....
as to the graph I already did it so don't worry about that part....