Question: Problem 2 Read the following R codes and the corresponding output then answer the questions. Model 1 without interaction library ( HSAUR 3 ) data
Problem
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
v womensroleagree
womensrole$disagree
size womensroleagreewomensroledisagree
size size minsize
size size maxsize
text womensrole$educationf yfVE
family "HersheySerif", cex size, col"red"
text womensrole$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
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
