I'm using poisson model to regress number of resistant bacteria (to antibiotic 1) over time. However, I would like to adjust for the fact that every year, there will inevitably be more resistant bacteria because the total amount of bacteria being reported into the lab is increasing per year. Below I have created a fake data frame with the first year of data (there are 5 years in total). With each year there is an increase in total number of bacteria tested. I understand I have to use the offset command to do this. Can I have some advice on how to do this with my data frame?I have used the following commands in stata but realised that when i offset in this way, it doesn't actually help because its not adjusting for the fact that more bacteria are being reported per year:
Additionally, when I put the above code into stata, I get the following output:
Any help is much appreciated.
poisson resistance1 yearmo, irr offset(total1)
Iteration 4: log likelihood = -5145028.5 (not concave)
Iteration 5: log likelihood = -5145007.3 (not concave)
Iteration 6: log likelihood = -5144995 (not concave)
Iteration 7: log likelihood = -5144989.6 (not concave)
Iteration 5: log likelihood = -5145007.3 (not concave)
Iteration 6: log likelihood = -5144995 (not concave)
Iteration 7: log likelihood = -5144989.6 (not concave)
Year | month | number of resistant bacteria to antibiotic 1 (resistance1) | total number of bacteria tested against antibiotic 1 (total1) | year and month (yearmo) |
2014 | 1 | 644 | 1673 | 2013m1 |
2014 | 2 | 658 | 1691 | 2013m2 |
2014 | 3 | 715 | 1798 | 2013m3 |
2014 | 4 | 706 | 1912 | 2013m4 |
2014 | 5 | 700 | 1929 | 2013m5 |
2014 | 6 | 756 | 1967 | 2013m6 |
2014 | 7 | 870 | 2151 | 2013m7 |
2014 | 8 | 870 | 2164 | 2013m8 |
2014 | 9 | 817 | 2095 | 2013m9 |
2014 | 10 | 811 | 2096 | 2013m10 |
2014 | 11 | 724 | 1891 | 2013m11 |
2014 | 12 | 765 | 1908 | 2013m12 |
Any help is much appreciated.
Comment