# Accessing more than two coefficients in a plot Classic List Threaded 3 messages Open this post in threaded view
|

## Accessing more than two coefficients in a plot

 I've successfully plotted (in the plot and abline code below) a simple regression of Lambda1_2 on VV1_2. I then successfully regressed Lambda1_2 on VV1_2, VV1_22 and VV1_212 producing lm2.l. When I go to plot lm2.l using abline I get the warning: "1: In abline(lm2.l, col = "brown", lty = "dotted", lwd = 2) : only using the first two of 4 regression coefficients" Is there another function like abline that will produce a line using the constant and three coefficients from the lm2.l regression? lm.l <- lm(Lambda1_2 ~ VV1_2, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE) # unweighted regression lm2.l <- lm(Lambda1_2 ~ VV1_2 + VV1_22 + VV1_212, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE) # unweighted regression plot(VV1_2, Lambda1_2, ylim=yrange, tck=1, main="V(1) Parameters (V, V^2 & V^0.5)", xlab="VV1_2", ylab="Lambda & Beta1_2",pch=19,col="red") {abline(lm2.l, col="brown", lty="dotted", lwd=2) abline(wlm2.l, col="gold",lty="longdash", lwd=2) points(VV1_2, Beta1_2, pch=19, col="blue") abline(lm2.b, col="black",lty="dotted", lwd=2) abline(wlm2.b, col="blue", lty="longdash", lwd=2) legend("topright", inset=.05, title="Parameters", labels, lwd=2, lty=c(1, 1, 1, 1, 2), col=colors) }     ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.