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
Race and age composition for 50 states in multiple yearsI'm working with ACS data where I'm gonna need state controls like - income per capita , unemploymen…
Heckman Selection model failing to convergeSorry if this is long, but I think the context is needed. I have a regression for estimating likeli…
OLS R^2 for large datasets inaccurate (lassogof)Dear community, I am using 'lassogof' to compare the performance of different Lasso, Elastic Net an…
Flipping (renaming) a stringHello, I have a series of varnames named year2010A | year2010B | ... | year2011A | year2011B | ... …
Interpreting turning poingHello, I have calculated the turning points of my models, but in one of them i first differenced som…
Subscribe to:
Post Comments (Atom)
0 Response to command
Post a Comment