Question: Categorical Data Analysis Stats Please R for all computations, and for building graphs in this part of the assignment. Note that we also want answers
4. (a) Modify the function PoissonReg from Example 30 from class to get a function that fits a logistic regression model with a binary response with Fisher Scoring For each line of code that you change, please give a sentence that describes the change. (For example, the residual deviance for binomial regression is...) As you write your function, it should output the following: - residual deviation and the corresponding degrees of freedom - null deviation and the corresponding degrees of freedom - estimate of the coefficients - estimated variance-covariance matrix for the estimation of the coefficients (b) Use your function on the data from the file FluShot.csv from Example 17 to fit a model to describe the probability of vaccination as a function of age, awareness, and gender (as an additive model). Display the estimation of the coefficients and the estimated variance-covariance matrix Remark: I am assuming the your dataframe is called flu.data. To get a vector of the responses and the design matrix, we can use the following commands. y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
