My model includes one response variable, five predictors and one interaction term for predictor_1 and predictor_2. I would like to plot partial residual plots for every pred
Another way to do this is to put the interaction term in as a separate variable (which avoids hacking the code for crPlot(...)
).
df <- data.frame(R,P1,P2,P1.P2=P1*P2)
lm.fit1 <- lm(R ~ ., df)
summary(lm.fit1)
crPlots(lm.fit1)
Note that summary(lm.fit1)
yeilds exactly the same result as summary(lm(R~P1*P2,df))
.