Hello everyone,
Im having trouble findind the right command to do this, hope you can help me. I need to generate a variable that tells me how many characteristics have every person surveyed. All the characteristics are satisfied when all these variables are = 1:
poco_int==1 | index_depr==1 | no_dormir==1 | cansancio==1 |no_apetito==1 | atencion==1 | moverse==1
Also the ID of each person is the variable HHID
Im going to describe an example for you to understand me better: Is like the person #8 fulfill poco_int=1 and cansancio=1 so they have 2 characteristics satisfied and the variable generated is going to be 2 for this person
hope my english is okay! thank you so much
Related Posts with Generate variable counting with conditions
A loop to predict a log-modelFor the model, Y= Yt-1+X1t+X2t+X3t+e I want to create a loop to predict future values such that the …
cond() functionHi all! I have the following dilemma. I would like to create variables such that: if a local takes…
remove certain string chars if in beginning of string var onlyDear Statalist, I have been searching for ways to remove a sequence of characters from a string var…
Moving average code to moving additive?By using a time-series dataset, I want to create a moving additive index. For example, I need a 5-ye…
Need for a permutation test ?Hi, STATA people, I have 12000 observation. I want to randomly assign a fake treatment value of 1 t…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable counting with conditions
Post a Comment