The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » sample weights in women file (weights must be constant within id)
sample weights in women file [message #19131] Thu, 23 April 2020 12:48 Go to next message
Laxmi Sharma is currently offline  Laxmi Sharma
Messages: 3
Registered: November 2019
Member
Hello,

I am trying to find out effect of education on mensuration hygienic methods and I am using district fixed effect .

When I am using sample weights in fixed effect model ,
gen wgt =sample_weights/1000000
gen id = state*1000 +distt
xtset id
xtreg san_nap own_edu hsbnd_edu i.wealth_index i.cast_trib i.religion i.place_type i.grouped_age [pw=wgt] ,fe cluster(id)

I am getting error weight must be constant within id.

I do not understand why ??

Thanks
Re: sample weights in women file [message #19222 is a reply to message #19131] Mon, 11 May 2020 20:12 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 721
Registered: January 2013
Senior Member
You have constructed id as a combination of the state and the district, but it says that the weight must be a constant within id. Weights will vary from cluster to cluster, so you need to include the cluster number in id.
Previous Topic: STATA codes to merge women and household datasets
Next Topic: Apply weight to merge data file
Goto Forum:
  


Current Time: Fri Sep 25 19:19:10 Eastern Daylight Time 2020