Assignment 3 Solution STAT 431|100% correct
ASSIGNMENT 3 - SOLUTIONS 1. [15 points] (a) [5 points] The likelihood for the data from the British for the most general multinomial model is P(Yij = yij , i = 1, . . . , 5; j = 1, . . . , 5|Y.. = y..) = y.. ! Q i Q j yij ! Y i Y j π yij ij where πij = µij µ.. and P i P j πij = 1. (b) [5 points] The form of the corresponding log-linear model that should be fit to assess the hypothesis of perfect social mobility in Britain is log µij = u + u X i + u Y j where the cornerpoint constraints are u X 1 = 0 and u Y 1 = 0 and X is the variable for the social class of the father and Y is the variable for the social class of the son. The R code used to assess the hypothesis of perfect social mobility in Britain is given below. data pa son ctry y 1 1 1 1 50 2 1 2 1 45 3 1 3 1 8 4 1 4 1 18 5 1 5 1 8 ... 26 1 1 2 18 27 1 2 2 17 28 1 3 2 16 29 1 4 2 4 ... # Make variables into factors data$paf-factor(data$pa) data$paft-C(data$paf,treatment) data$sonf-factor(data$son) data$sonft-C(data$sonf,treatment) data$ctryf-factor(data$ctry) data$ctryft-C(data$ctryf,treatment) # Get the data for Britain -data[data$ctry==1,] # Fit the model without the two way interaction model1-glm(y~paft+sonft,family=poisson,data=) summary(model1) Call: glm(formula = y ~ paft + sonft, family = poisson, data = ) Deviance Residuals: Min 1Q Median 3Q Max -8.490 -4.773 -1.148 3.115 12.857 Coefficients: Estimate Std. Error z value Pr(|z|) (Intercept) 1.33488 0.13099 10.19 2e-16 *** paft2 1.34475 0.09884 13.61 2e-16 *** paft3 1.39016 0.09839 14.13 2e-16 *** paft4 2.46005 0.09172 26.82 2e-16 *** paft5 1.87952 0.09452 19.89 2e-16 *** sonft2 1.55763 0.10835 14.38 2e-16 *** sonft3 1.49432 0.10896 13.71 2e-16 *** sonft4 2.63000 0.10195 25.80 2e-16 *** sonft5 2.28988 0.10333 22.16 2e-1
Written for
- Institution
- University Of Washington
- Course
- STAT 431
Document information
- Uploaded on
- January 15, 2023
- Number of pages
- 9
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
assignment 3 solution university of waterloo stat 431