EC_DHSwts | R Documentation |
In order to use a nationally-representative population for cluster analysis, 'EconomicClusters' uses weighted k-medoids clustering from the package 'WeightedCluster'. If employed for analysis of Demographic and Health Surveys (DHS) data, we recommend using the weights used by the DHS to calculate the wealth index (Rutstein, n.d.). 'EC_DHSwts' generates a vector of weighted number of household members using methods described in the DHS protocol (Rutstein, n.d.).
EC_DHSwts(X, dejure, defacto, HHwt)
X |
a data frame of all asset variables to be considered for variable selection coded as factors with column names specified |
dejure |
the variable specified by the DHS to describe number of dejure household members (see the DHS recode manual for your country for details) |
defacto |
the variable specified by the DHS to describe number of defacto household members (see the DHS recode manual for your country for details) |
HHwt |
DHS household weight variable (see the DHS recode manual for your country for details) |
As per DHS protocols for generation of the wealth index (Rutstein, n.d.), 'EC_DHSwts' multiplies the household sampling weight by the number of dejure household members (or the number of defacto household members if number of dejure members = 0) and divides the result by 1,000,000.
A data frame with Column 1 containing weighted number of household members and Columns 2 through n containing all asset variables to be considered for variable selection
'EconomicClusters' can be used with other nationally representative household-level surveys that ask about assets. Weights appropriate to the given survey should be applied.
Lauren Eyler economic.clusters@gmail.com
Rutstein SO. (n.d.). Steps to Constructing the New DHS Wealth Index. ICF International: Rockville, Maryland, <http://dhsprogram.com/programming/wealth%20index/Steps_to_constructing_the_new_DHS_Wealth_Index.pdf>
EC_vars
, EC_time
, EconomicClusters
, HH_survey
, assets
#In our sample data set, relevant variables are coded as follows: #HH_survey$HHwt = household sampling weight #HH_survey$dejure = number of dejure household members #HH_survey$defacto = number of defacto household members #Let's assume that we have already made a data frame containing only #the asset variables we will consider for variable selection, called 'assets'. #Now, let's create a data frame containing DHS weights as the first column #and all asset variables to be considered for selection as the subsequent columns. data(HH_survey) data(assets) data_for_EC<-EC_DHSwts(assets, HH_survey$dejure, HH_survey$defacto, HH_survey$HHwt) #data_for_EC is now a data frame in the format needed to run 'EC_time' or 'EconomicClusters'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.