lmEqn | R Documentation |
This function plots the points given, then fits a line and displays the
regression statistics using lattice
.
lmEqn( formula = NULL, data = NULL, method = "lm", leg.loc = c(0.5, 0.5), theme = screenTheme(), ... )
formula |
A formula with both LHS and RHS. The formula should comply
with the usual |
data |
A data frame containing two columns whose names correspond to the specified formula. |
method |
A character string. Either "lm" for linear model or "rlm" for a robust fit. |
leg.loc |
A vector of two numbers (x, y) giving the location of the legend. The values correspond to the units of the data. See the examples. |
theme |
Character; A suitble |
... |
Additional arguments to be passed downstream. |
A plot is drawn and the ggplot2
or lattice
object is
returned, possibly for further manipulation.
Bryan A. Hanson, DePauw University. hanson@depauw.edu
require("lattice") require("latticeExtra") require("plyr") require("MASS") conc = seq(1, 12, length.out = 8) abs = jitter(conc, factor = 2)*0.1 cc <- data.frame(conc, abs) lmEqn(formula = abs ~ conc, data = cc, method = "rlm", leg.loc = c(3, 0.1), xlab = "concentration", ylab = "absorbance", main = "Calibration Curve")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.