The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » Proportions
Re: Proportions [message #10608 is a reply to message #10603] Tue, 16 August 2016 10:40 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3230
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

I suggest that you construct the proportion of households in the cluster that have electricity with a collapse command. You could do this from the HR file or from the PR file, selecting one record per household. Then merge that back with the PR file or whatever other file you are using. The lines below show how to construct this proportion. You do not need to use the weights because the weights are constant within clusters. Let me know if this is not what you need.

use KEPR70FL.dta, clear
keep if hvidx==1
keep hv001 hv206
tab hv206
collapse (mean) hv206, by(hv001)
rename hv206 electricity
label variable electricity "Prop. of hh in cluster with elect."
sort hv001
* next merge this file with whatever other file you are using
 
Read Message
Read Message
Previous Topic: Missing variables in data set
Next Topic: House hold sample weight
Goto Forum:
  


Current Time: Mon Jan 27 23:04:19 Coordinated Universal Time 2025