##### Code for Lecture on Poisson regression ### Example - effects of age and birth location (wild or captive) ### on litter sizes in red wolves ### Litter size is not normally distribution (skewed to the left) ### and isn't continuous ###import the data datum=read.csv(file.choose()) ###Analyze the data using glm help(glm) ### glm is the same as lm, but requires an additional argument ### family, which specifies what the error structure is results=glm(LitterSize~Age+BirthLoc,data=datum,family=poisson) ### runs a Poisson regression summary(results) #examine the results