Hi there, I am trying to compute 95% confidence intervals of sample proportions in SAS enterprise guide. I have computed overall percentages and divided these by 100 to produce p-hat (0.0328) using proc sql. Referring to the code below, I then tried to compute confidence intervals using the code below but it does not compute the correct number (I have done these done correctly in excel, I should be getting .02884 but I am getting .03279 instead using the code below). Below is the lower CI, and the same problem happens for the upper CI. The 7810 below in the code refers to the number of my sample. I am new to SAS so I would appreciate any help or feedback. I have heard that proc freq data could be used (the overall percentages I have computed are derived from the original data, they are percentage differences of two totalled columns) but I don't know where to begin in computing the CIS in this way, but if this was a better way to do it, I have access to the raw data. Thanks so much in advance. Proc sql; create table CI as select (p_hat-(1.96*SQRT(p_hat*(1-p_hat))/7810)) as CI from P_hat_data; Quit;
... View more