[datatable-help] Predictions and Poisson

sarah.harding ness.wall at hotmail.co.uk
Tue Jan 3 22:24:32 CET 2017


I have been asked to do the following task:
/'Using the data-frame in DoctorVisits.Rda, 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, 30-50, >50), sex and illness. Holding sex and number
of illnesses constant at their mean values, what are the predicted rates of
visits to a doctor
over a two week period for different age groups.' /

I have ran my Poisson regression... 
M.dr <- glm(visits ~ age.category + gender + illness,
            +             data=DoctorVisits,
            +             family=poisson)

But now I am stuck on how to input gender as a constant mean in the
prediction function. So far I have...
 predictor.values <- with(DoctorVisits,
data.frame(age.category=c('<30', '30-50','>50'), illness=mean(illness),
gender= *??????*)

I do not know what to put in for the gender variable as I am dealing with
factors. Will be grateful for the help. Thanks. 




--
View this message in context: http://r.789695.n4.nabble.com/Predictions-and-Poisson-tp4727833.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list