Hello,
I have this type of data:
ID start_study end_study
1 01APR2010 20OCT2010
2 01APR2010 01APR2014
3 01Nov2010 20OCT2015
4 01APR2010 20OCT2016
5 01APR2010 20APR2010
.......
The period I am looking in is from 01APR2010 till 01APR2017. I want to create a variable for each month: 84 varibles.
The start_study is the date when a person joined a group and end_study is the date when he left it. I want to calculate for each person how many days per month a person belonged for a group, for example:
ID=1 in first month (april 2010) was in group for 30 days, in second month (may 2010) was for 31 days , ...., in seventh month (octorber 2010) was for 20 days and after would be 0 cause he left the group.
what would be the best way to do this?
thank you
... View more