About this Resource

The following steps produce a weight variable that you can use for analysis where you want each macro unit to contribute equally.

Example 3: produce a weight variable
  1. Generate a variable that, for every micro unit within a given macro unit, takes the value of the sum of surveyweight within that macro unit. In Stata this can be done using the following command.

    bysort macrounit: gen muess = sum(surveyweight)

    You can use whatever variable name you like, but muess stands for macro unit effective sample size.

  2. Generate a variable that gives the average number of micro units per macro unit. You can do this by hand. Find out the number of micro units and the number of macro units in the data (without weighting) and divide the former by the latter. Note that this variable will be a constant for all units in your data set, so having calculated the number, x, you can generate the variable, in Stata, with the command.

    generate avepermu = x

  3. Generate the analysis weight using the following formula.

    generate analysisweight = (avepermu/muess)*surveyweight

The University of Manchester; Mimas; ESRC; RDI

Countries and Citizens: Unit 4 Combining macro and micro data by Steve Fisher, University of Oxford is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales Licence.