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
Absolute coefficient of variation as a new variableDear Forum Users; I have been trying to calculate the absolute coefficient of variation for two dif…
Connect VariablesHi everyone, hope you had a nice Christmas. I am having some Stata issues and i hope that someone …
Labeling observations in qnorm plotHello all I would like to add a label to the observations that isn't normally distributed in my qno…
Labeling values less than 1Hello, I would like to label values of less than 1 and am running into an error: "may not label .33…
Mean/median difference between quintiles significant and how to calculateHi, I want to calculate whether the difference between the mean (and median) of COGS elasticity of …
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable with if
Post a Comment