Hello,
Currently I have a database with the donators and theirs giving in UK. I had create 4 column : giv2, giv4, giv6, giv8 and if the person has given in the wave 2 the value in giv2 is 1; same reasoning for the others giv4,6,8.
I would like to create 4 new column with :
- never : never give on the 4 waves
- seldom : give 1 time over the 4 waves
- Time to time : give 2 or 3 times over the 4 waves
- Always : give 4 times over the 4 waves
I don't know how to do it, maybe with a max function ?
For the seldom this one could be work ? : bysort pidp: egen seldom = max(giv2==1 & giv4==1 & giv6==1 & giv8==1)
Thanks for your help
Related Posts with Generate new variable with if
Sample selection for a panel: struggling with panel bootstrap in the programDear Statalisters, I am using Stata 15.1 and I would like to address the sample selection problem i…
Survey dataGood morning I need some advice for my master thesis please. My data is a cross-sectional survey. A…
How do i open one of these .dat files?https://data.nber.org/data/cps_basic.html for example March 2015 how would i open this in Stat? Than…
define constraints for baseoutcome in mlogitI want to estimate a mlogit model Code: mlogit depvar ibn.fvar1 othervars there are categories in m…
Cleaning data of Globar Entrepreneurship MonitorDear All, I am currently dealing with cross-sectional studies derived from the Global Entrepreneurs…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable with if
Post a Comment