The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Community level variable (How to create community level variables from individual variable.)
Re: Community level variable [message #20262 is a reply to message #20257] Fri, 16 October 2020 10:19 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

There have been some earlier postings on this topic. For the most part you can do what you want with variations on the "egen" command. For example if you want to construct a variable that is the proportion of women in the cluster who have no secondary schooling, you could use these commands: "gen no_school=0; replace no_school=1 if v106==0; egen no_school_prop=rowmean(no_school, by(v001).

I suggest you enter "help egen" and then look at the commands for which "by" is allowed. To get a cluster-level variable you use "by(v001)".

The clusters are often treated as villages or neighborhoods or communities, but of course they are actually census enumeration areas and their boundaries may or may not be appropriate for this interpretation.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Guidance regarding Gender Pooling in Liberia 2013 DHS data
Next Topic: DOTS OR MISSING VALUES IN BREASTFEEDING SURVEY
Goto Forum:
  


Current Time: Fri Dec 20 23:23:34 Coordinated Universal Time 2024