Description Usage Arguments Value Author(s) See Also Examples
This function creates a scatter plot of two continuous variables and adds the fitted simple linear regression line.
1 2 3 4 5 6 7 8 9 10 |
Data |
Data frame with response and dependent variable |
respVar |
String of the response variable's name in Data |
depVar |
String of the dependent variable's name in Data |
printPVal |
Logical: TRUE indicates p-value for beta1 = 0 is printed in margin of plot |
printModel |
Logical: TRUE indicates fitted model is printed in margin of plot |
printRsq |
Logical: TRUE indicates multiple R-squared is printed in margin of plot |
returnList |
Logical: TRUE returns list of Coefficient and P-Value |
... |
Any other arguments that can be used by plot() |
Plots a scatterplot and regression line. Returns list of beta1 coefficient and p-value
University of Wisconsin-Madison Biostatistics and Medical Informatics Department, Scott Hetzel M.S.
plot(), abline(), lm()
1 2 3 4 5 6 7 8 9 10 11 12 | Xvar <- rnorm(50, -10, 1)
Yvar <- 0.5 * Xvar + rnorm(50, 0, 1)
dfLin <- data.frame(Xvar, Yvar)
layout(1)
uwSimpleReg(
Data = dfLin, respVar = "Yvar", depVar = "Xvar",
main = "Example of uwSimpleReg",
ylab = "Example Response", xlab = "Example Explanatory",
ylim = NULL, xlim = NULL, printPVal = TRUE, printModel = TRUE, printRsq = TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.