I have a data-set in which I need to perform a Poisson regression analysis of how number of visits to the doctor in the two week period varies as a function of age group (i.e.<30, between 30 and 50, and >50), sex and illness. Holding sex and number of illnesses constant at their mean values.
Here is a sample of my data:
visits gender age illness
1 female 19 1
1 female 19 1
1 male 19 3
1 male 19 1
1 male 19 2
1 female 19 5
1 female 19 4
1 female 19 3
1 female 19 2
1 male 19 1
However, I do not know how to go about this as I don't know how to correctly input these groups. As I need to discover the predicted rates of visits to a doctor over a two week period for different age groups.
I know how to input the initial equation: glm(visits ~ age + gender + illness, data=DoctorVisits, family=poisson)
But I do not know how I would go about creating the predict function.
cut.cut. Study its documentation.