01-10-2012 04:44 PM
this is my problem, I have a database of lessons presidential, with variables, candidate 1, candidate 2, Total_ votes, Strata.
And what I want is to calculate the estimators of reason, or proportion between a candidate and the total votes, and estimate of the total votes cast, their corresponding variances and their corresponding deff.
My program is as follows:
PROC SORT DATA=PREP2006 OUT=ORDER_PREP2006; BY STRATA;
PROC SURVEYSELECT DATA=ORDER_PREP2006
OUT=WORK.SAMPLING METHOD=SRS N=3;
PROC PRINT DATA=SAMPLING (OBS=10);
*proportion between a candidate and the total votes;
PROC SURVEYMEANS DATA=SAMPLING;
RATIO CAN21 CAND2 / TOTAL_VOTES ;
*ESTIMATED TOTAL VOTES ^T;
PROC SURVEYMEANS DATA=SAMPLING SUM VARSUM STD RANGE NMISS CVSUM CLSUM;
*THE FOLLOWING PROC ME BACK THE DEFF, BUT NOT ON THE ESTIMATOR TOTAL OF TOTAL VOTES;
PROC SURVEYFREQ data=SAMPLING;
TABLE TOTAL_VOTES / DEFF;
HOW TO GET the following estimates?
* estimates of population means and totals
* estimates of population proportions
* standard errors
* confidence limits
* deff For each ESTIMATOR
* ratio estimates