Page 1 of 1

Weights

Posted: April 2nd, 2012, 9:39 am
by Sol
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

Re: Weights

Posted: April 2nd, 2012, 5:44 pm
by Gregory Martin
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.

Re: Weights

Posted: June 5th, 2012, 3:40 pm
by Sol
Thanks Martin