Would you please show me how to add wights in the dictionnary and use it on tabulation. I apperciate also an explanation about weights, how they are drived and used
Thanks
Weights
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Weights
Generally you will use a batch edit application to add weights to a data file. Often you use the external file lookup features of CSPro to identify the weights. That is, you will have a file, prepared in Excel or another application, that contains each geographic area (an enumeration area or a cluster) and the weight for that area. Using a lookup file (with the loadcase function), you look up the weight for each case in your data file. Your code might look something like this:
PROC QUEST
if loadcase(WEIGHTS_DICT,CLUSTER) then
WEIGHT = CLUSTER_WEIGHT; // add the weight to the data file, taking it from CLUSTER_WEIGHT in the lookup file
else
errmsg("Cluster was not found in the weights lookup file!");
endif;
Once you've added the weights, in your tabulation application you specify the weight variable in the Weight option under Tally Attributes.if loadcase(WEIGHTS_DICT,CLUSTER) then
WEIGHT = CLUSTER_WEIGHT; // add the weight to the data file, taking it from CLUSTER_WEIGHT in the lookup file
else
errmsg("Cluster was not found in the weights lookup file!");
endif;