I am trying to generate new variable named, number of household in community who get credit with "NoHHCom_credit". The data set I have is survey data with 38 number of community in the country. In the data set, there is data about either the household get credit or not with variable name "hh_s14q01" and with 1=yes or 0=no, answers. the community dummy is represented by variable "saq07" and there is 38 communities.
The command I tried was
gen NoHHCom_credit = sum(hh_s14q01==1), if inrange(saq07==1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,3 2,33,34,35,36,52,53)
Please may you help me
Related Posts with command
Margins at() following cmxtmixlogit / cmclogit?Hi all, long time reader first time poster here. I am using StataSE 16.1 on MacOS 11.2.3. I'm analyz…
spectral normalization matrixHi all, I've made a matrix based on the similarity of organizations in forums (Euclidean distance):…
similarity ratio matrix Hi all, I have 150 forums and proportion of participants who said they were interested in 7 differ…
Dividing variables across time periodsHi Statalister, I have a problem in which I cannot solve, I tried a number of things and I have tri…
Dummy variable based on 3 continuous year panel dataHi, I want to generate dummy2=1 if dummy1 is continuous (equal 1) for the 3 next years period. Any…
Subscribe to:
Post Comments (Atom)
0 Response to command
Post a Comment