Dear all, hopefully the dataex example works correctly to illustrate the dummy data set. I have pasted both the dataex code and have also attached an image of the dummy dataset for a quick view for better understanding of the data.
How do I generate a variable AprilToMay to indicate the change in an individual possessing membership between April to May? For example, individual A didn't have membership in April and now has membership in May, so the variable AprilToMay should be "Gained membership" for individual A. Similarly, individual B already had membership in April and also has membership in May, so AprilToMay should be "Retained membership" for individual B.
Similarly I'd use the same code to generate a variable MayToJune to describe individuals who retained membership and who lost their membership between May and June.
This is a dummy dataset, the actual dataset has a lot more time periods and a lot more individuals, and a lot more parameters than membership.
Thanks in advance!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2 ID str5 Month float HasMembership "A" "APRIL" 0 "B" "APRIL" 1 "C" "APRIL" 0 "D" "APRIL" 1 "E" "APRIL" 0 "F" "APRIL" 1 "A" "MAY" 1 "B" "MAY" 1 "C" "MAY" 1 "D" "MAY" 1 "E" "MAY" 1 "F" "MAY" 1 "A" "JUNE" 1 "B" "JUNE" 0 "C" "JUNE" 1 "D" "JUNE" 0 "E" "JUNE" 1 "F" "JUNE" 0 end
Similarly I'd use the same code to generate a variable MayToJune to describe individuals who retained membership and who lost their membership between May and June.
This is a dummy dataset, the actual dataset has a lot more time periods and a lot more individuals, and a lot more parameters than membership.
Thanks in advance!
Comment