Below is a table from SAS result. What formula was used to calculate the "Std Err of Percent" in this table?
I know, SE of percent = (True percent - observed percent)/True percent. I believe the "Percent" column has the observed percent (correct me if I am wrong). I thought true percent for Male-Negative is 1*100/9=11.1%. So, SE of percent=(11.1-7.5605)/11,1=0.3189. But the table shows 7.5159. My brain is not working. Please help.
Gender | Result | Frequency | Weighted Frequency |
Std Err of Wgt Freq |
Percent | Std Err of Percent |
95% Confidence Limits for Percent |
|
---|---|---|---|---|---|---|---|---|
Male | Negative | 1 | 16.20746 | 16.20746 | 7.5605 | 7.5259 | 0.0000 | 22.6253 |
Positive | 4 | 64.82982 | 31.56546 | 30.2419 | 14.4387 | 1.3398 | 59.1441 | |
Total | 5 | 81.03728 | 34.96896 | 37.8024 | 15.9078 | 5.9594 | 69.6454 | |
Fem | Negative | 3 | 100.00000 | 56.73086 | 46.6482 | 18.0779 | 10.4613 | 82.8350 |
Positive | 1 | 33.33333 | 33.33333 | 15.5494 | 14.1520 | 0.0000 | 43.8778 | |
Total | 4 | 133.33333 | 64.91964 | 62.1976 | 15.9078 | 30.3546 | 94.0406 | |
Total | Negative | 4 | 116.20746 | 58.52508 | 54.2087 | 17.5366 | 19.1054 | 89.3120 |
Positive | 5 | 98.16316 | 45.08850 | 45.7913 | 17.5366 | 10.6880 | 80.8946 | |
Total | 9 | 214.37061 | 71.16743 | 100.0000 |
Show starting data in the form of a data step.
Show the code for creating that output.
Then we have some clue of what is going on.
Example of a starting data and SAS code are mentioned below. Actually, I am curious, what formula was used to calculate the "Std Err of Percent" in the back end?
data have; input ID Gender $ Result $; datalines; 1 Male Positive 2 Male Negative 3 Female Negative 4 Female Negative 5 Male Positive 6 Male Positive 7 Female Positive 8 Female Negative 9 Male Positive ; Data have; set have; if Gender="Male" then Prob=0.0617; if Gender="Female" then Prob=0.0300; Wt=1/Prob; run; proc surveyfreq data=have; table Gender*Result / cl; Weight wt; run;
This appears to be output from Proc SURVEYFREQ which means the standard errors are calculated factoring in the design effect (strata, cluster and weight). There are a number of different methods (controlled by the VARMETHOD= option on the SURVEYFREQ statement) for calculating them so I would suggest you reference the documentation:
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.