How to get the four graphs generated (one separated from the other/one at a time) from the regression analysis not by using the console / prompt (Hit <Return> to see next plot:
)?
if(!require("truncnorm")) install.packages("truncnorm") ; library(truncnorm)
FACTORA <- c(0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
FACTORB <- c(0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
FACTORC <- c(0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
FACTORD <- c(0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
FACTORE <- c(0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
planDOE <- data.frame(FACTORA,
FACTORB,
FACTORC,
FACTORD,
FACTORE,
rtruncnorm(n=32, a=0, mean=61.16, sd=31.32))
rg <- lm(planDOE)
plot(rg)
I tried the following ways and did not succeed (either using true or false in the ask argument commands ask
).
plot(rg)
par(ask=TRUE)
#
par(ask=FALSE)
plot(rg)
#
plot(rg, ask = FALSE)
#
par(mfrow=c(2,2))
plot(rg)
# In one image it can put together the graphic information.
#
png('test2.png', units="in", width=13, height=7, res=300)
plot(rg)
dev.off()
In this last way, I realize that it is possible to obtain the graph separately, but only saves the graph of residuals.
The answer:
plot(rg, which = 1)
plot(rg, which = 2)
#...