Dear all,
Hope everything goes well with you.
I am new to STATA and having a problem in creating frequency tables.
Dataset looks as below:
input byte(id aspirin2006 clopidogrel2006 statin2006 fibrate2006 aspirin2007 clopidogrel2007 statin2007 fibrate2007 aspirin2008 clopidogrel2008 statin2008 fibrate2008 aspirin2009 clopidogrel2009 statin2009 fibrate2009 aspirin2010 clopidogrel2010 statin2010 fibrat2010) int str12 first_date last_date
1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 2007 2010
2 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 2006 2010
3 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 2007 2009
4 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 2006 2010
5 0 0 0 1 0 0 0 1 0 0 0 1 0 1 1 1 1 1 1 1 2007 2009
6 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 2006 2010
7 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 0 2006 2009
8 1 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 2007 2010
9 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 2006 2010
end
I would like to create the following tables:
Table 1
table 2
Would really appreciate if you may help me to solve the problem.
Thank you in advance.
Kind regards,
Oyun
Hope everything goes well with you.
I am new to STATA and having a problem in creating frequency tables.
Dataset looks as below:
input byte(id aspirin2006 clopidogrel2006 statin2006 fibrate2006 aspirin2007 clopidogrel2007 statin2007 fibrate2007 aspirin2008 clopidogrel2008 statin2008 fibrate2008 aspirin2009 clopidogrel2009 statin2009 fibrate2009 aspirin2010 clopidogrel2010 statin2010 fibrat2010) int str12 first_date last_date
1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 2007 2010
2 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 2006 2010
3 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 2007 2009
4 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 2006 2010
5 0 0 0 1 0 0 0 1 0 0 0 1 0 1 1 1 1 1 1 1 2007 2009
6 1 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 2006 2010
7 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 0 2006 2009
8 1 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 2007 2010
9 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 2006 2010
end
I would like to create the following tables:
Table 1
Year | Patient No | Prescription No | Mean No of prescription per person | ||
Anti-thrombotic | Lipid lowering | Anti-thrombotic | Lipid lowering | ||
2006 | |||||
2007 | |||||
2008 | |||||
2009 | |||||
2010 |
Year | Prescription No | |
One class (anti-thrombotic or lipid lowering ) | Two classes (anti-thrombotic + lipid lowering ) | |
2006 | ||
2007 | ||
2008 | ||
2009 | ||
2010 |
Thank you in advance.
Kind regards,
Oyun
Comment