plotReg {LearningStats}R Documentation

Representation of a Linear Regression Model

Description

Representation of a Linear Regression Model

Usage

plotReg(x, y, main = "Linear Regression Model",
  xlab = "Explanatory variable (X)", ylab = "Response variable (Y)",
  col.points = "black", col.line = "red", pch = 19, lwd = 2,
  legend = TRUE)

Arguments

x

a numeric vector that contains the values of the explanatory variable.

y

a numeric vector that contains the values of the response variable.

main

a main title for the plot; default to "Linear Regression Model".

xlab

x-axis label; default to "Explanatory variable (X)".

ylab

y-axis label; default to "Response variable (Y)".

col.points

a single colour associated with the sample points; default to "black".

col.line

a single colour associated with the fitted linear regression model; default to "red".

pch

an integer specifying a symbol or a single character to be used as the default in plotting points; default to 19.

lwd

line width for the estimated model, a positive number; default to 2.

legend

logical value; if TRUE (default), a legend with details about fitted model is included.

Value

This function is called for the side effect of drawing the plot.

Examples

x=rnorm(100)
error=rnorm(100)
y=1+5*x+error
plotReg(x,y)

[Package LearningStats version 0.1.0 Index]