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.)
Community level variable [message #20257] Fri, 16 October 2020 05:39 Go to next message
saifulhaq is currently offline  saifulhaq
Messages: 3
Registered: October 2019
Member
Hello,
Can any one tell how to create community level variable using individual level variable on STATA. Please share do.file because i am clueless on how to generate community level variables using STATA. Your help shall be a huge contribution.
Looking forward,


Saif
Pakistan.
Re: Community level variable [message #20262 is a reply to message #20257] Fri, 16 October 2020 10:19 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1979
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.
Previous Topic: Guidance regarding Gender Pooling in Liberia 2013 DHS data
Goto Forum:
  


Current Time: Thu Oct 29 14:54:18 Eastern Daylight Time 2020