# Use Poisson regression to examine Errors by Recognizer and Hand

**COnducting Planned Comparisons Coursera Quiz**

Qn5. Download the file hwreco.csv from the course materials. This file describes a study of three handwriting recognizers (A,B,C) and subjects who were either right-handed or left-handed. The response is the number of incorrectly recognized handwriting words out of every 100 handwritten words. The research questions are how each recognizer fared overall and whether a given recognizer performed better for right-handed or left-handed writers. How many subjects took part in this study?

Qn6. **Create an interaction plot with Recognizer on the X-axis and Hand as the traces**. How many times, if any, do the two traces cross?

Qn7. **Fit Poisson distributions** to the Errors of each of the three Recognizer levels and test those fits with goodness-of-fit tests, To the nearest ten-thousandth (four digits), what is the lowest p-value produced by these tests? Hint: To fit a Poisson distribution, use the fitdistrplus library and its fitdist function. Then test the fit with the gotstat function.

Qn8. Use **Poisson regression to examine Errors** by Recognizer and Hand. To the nearest ten-thousandth (four digits), What is the p-value of the recognizer * hand interaction? Hint: Create a model with glm using family – poisson. Then use the car library and its Anova function with type = 3. Prior to either, set sum-to-zero contrasts for bot recognizer and Hand.

Qn9. Conduct three **planned comparisons** between left-and right-handed recognition errors within each recognizer, Adjust for multiple comparisons using Holm’s sequential Bonferroni procedure. What is the lowest corrected p-value form such tests? Hint: use the multcomp and lsmeans libraries and the lsm formulation of the right glht function. Because we only have three planned pairwise comparisons, use “non” for the initial multiple comparisons adjustment to avoid correcting for all possible pairwise comparisons. Instead, just find the three planned and as=ye uncorrected p-values and pass them manually to p.adjust with method=”holm”.

Qn10. Which of the following conclusions are supported by the analyses we performed on hwreco.csv? (Mark all that apply)

```
The handwriting counts seemed to be Poisson-distributed.
There was a significant main effect of Recognizer on Errors
There was a significant main effect of hands on Errors
There was a significant Recognizer * Hand interaction
For recognizer ‘a’ there were significantly more errors for right-handed writers that left handed writers.
For recognizer B, there were significantly more errors for left-handed writers than left-handed writers.
For recognizer C, there were significantly more errors for right-handed writers than left-handed writers.
```