Displaying 1 result from an estimated 1 matches for "linreg0".
Did you mean:
linreg
2013 Feb 15
2
Making the plot window wider and using the predict function
...set contains the variables "Bwt" and "Hwt", which are bodyweight and heartweight, respectively, of a group of cats.
With the following code, I am making two plots, both to be viewed in the same plot window in R:
library(MASS)
maleData <- subset(cats, Sex == "M")
linreg0 <- lm(maleData$Hwt ~ maleData$Bwt)
par(mfrow=c(1,2))
plot(maleData$Hwt ~ maleData$Bwt)
plot(rstandard(linreg0) ~ fitted(linreg0))
My problem is that the two plots end up all oblong and squashed, because the plot window doesn't have a size suited for having two plots next to one another....