## Doing Generalized Linear Models - Coursera quiz online

**Doing Generalized Linear Models**

Qn1. Download the file **deviceprefssex.csv** from the course materials. This file describes the same study as in our deviceprefs.csv file, but now augmented with a column for sex (M,F). It also still contains a column for disability (1,0). The research question is how preference for either touchpads or trackballs differs by disability status and sex. How many subjects took part in this study?

Qn2. Use **binomial regression** to examine Pref by Disability and sex. To the nearest ten-thousandth (four digits), what is the p-value f the Disability * Sex interaction? Hint: Create a model with glm using family=binomial. The use the car library and its Anova function with type = 3. Prior to either, set sum-to-zero contrasts for both disability and sex.

Qn3. **Multinomial regression generalizes binomial regression** to dependent variables with more than two categories, so it can handle just two categories as well. Use multinomial regression to examine Pref by Disability and Sex, To the nearest ten-thousandth (four digits), what is the p-value of Disability * Sez interaction? Hint: use the nnet library and its multinom function, The use the car library and its Anova function with type = 3. Prior to either, set sum-to-zero contrasts for both Disability and Sex.

Qn4. Let us examine whether there was a significant preference for touchpads or trackballs within each Disability * Se combination. Conduct such exploration using post hoc binomial tests. A djust for multiple comparisons using Holm’s sequential Bonferroni procedure. What is the lowest corrected p-value produced by such an exploration? Hint: Conduct four separate tests with binm.test. The four tests correspond to the four combinations of Disability and Sex. For each combination, test the sum of rows preferring “touchpad” against all rows having that same Disability * Sex combination. Since there are only two devices, a test for touchpad is implicity a test for trackball, and vice versa.