Re: Community level variable [message #21554 is a reply to message #20530] |
Wed, 18 November 2020 14:27 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:
You scored this variable to be either 0 or -1? Do you mean 1 and 0? Usually a binary variable is coded 1 for yes and 0 for no.
The mean of a binary variable x is the proportion of cases that are coded 1.
If you want to get that proportion (or the mean of x) within clusters the command is "egen X=mean(x), by(v001)". The PSU is given by v001 or v021.
|
|
|