Question: Problem 1 Use the clouds data from package HSAUR 3 to build a multiple regression model of the dependent variable rainfall. a ) Consider all
Problem
Use the clouds data from package HSAUR to build a multiple regression model of the dependent variable
rainfall.
a Consider all other variables as potential factors in the model this is so called full model
b Add potential interaction effects if there is any use graphical way to help you interpret
c Remove some nonsignificant variables from the model and compare the new model with the full model.
d Use the residuals against fitted values of the new mode from c to check the normality assumption.
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
y womensroleagree
womensrole$disagree
size womensroleagreewomensroledisagree
size size minsize
size size maxsize
textwomensrole$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
mfrow
myplotrolefitted
myplotrolefitted
Please do each problem and write the code for each in R
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
