hospitalstay.data<- read.csv(file="./PoissonExampleData.csv", header=TRUE, sep=",")
#fitting Poisson model
summary(fitted.model<- glm(days ~ gender + age + illness,
data=hospitalstay.data, family=poisson(link=log)))
#using fitted model for prediction
print(predict(fitted.model, data.frame(gender="M", age=55, illness="no"),
type="response"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.