Question: Problem 2 A ) compare these two models and write a summary of the findings. Read the following R codes and the corresponding output then
Problem
A compare these two models and write a summary of the findings.
Read the following R codes and the corresponding output then answer the questions.
Model without interaction
libraryHSAUR
datawomensrole
fm cbindagreedisagree ~ gender education
womensroleglm glmfm data womensrole, family binomial
role.fitted fittedwomensroleglm
#role.fitted predictwomensroleglm type "response"
Plot function
myplot functionrolefitted
f womensrole$gender "Female"
plotwomensrole$education, role.fitted, type n
ylab "Probability of agreeing",
xlab "Education", ylim c
lineswomensrole$educationf role.fittedf lty
lineswomensrole$educationf role.fittedf lty
lgtxt cFitted Males "Fitted Females
legendtopright lgtxt lty : bty n
y womensroleagree
womensrole$disagree
size womensroleagreewomensroledisagree
size size minsize
size size maxsize
text womensrole$educationf yfVE
family "HersheySerif", cex size, col"red"
textwomensrole$educationf yfMA
family "HersheySerif", cex size, col"blue"
Model with interaction
fm cbindagreedisagree ~ gender education
womensroleglm glmfm data womensrole, family binomial
role.fitted fittedwomensroleglm
Call myplot fuction
parmfrowc
myplotrolefitted
myplotrolefitted
Figure : the top figure is from model and bottom figure is from model with interaction
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
