Learn R Programming

MVar (version 2.0.4)

Plot.Regr: Graphs of the linear regression results.

Description

Graphs of the linear regression results.

Usage

Plot.Regr(Reg, TypeGraf = "Scatterplot", Title = NA,
          xlabel = NA, ylabel = NA, NameVarY = NA, 
          NameVarX = NA, Color = TRUE, IntConf = TRUE, 
          IntPrev = TRUE, Casc = TRUE)

Arguments

Reg

Regression function data.

TypeGraf

Type of graphic: "Scatterplot" - Scatterplot 2 to 2, "Regression" - Graph of the linear regression, "QQPlot" - Graph of the normal probability of the residues, "Histogram" - Histogram of the residues, "Fits" - Graph of the adjusted values versus residuals, "Order" - Graph of the order of the observations versus the residuals.

Title

Titles of the graphics, if not set, assumes the default text.

xlabel

Names the X axis, if not set, assumes the default text.

ylabel

Names the Y axis, if not set, assumes the default text.

NameVarY

Variable name Y, if not set, assumes the default text.

NameVarX

Name of the variable, or variables X, if not set, assumes the default text.

Color

Colored graphics (default = TRUE).

IntConf

Case TypeGraf = "Regression". Graphics with confidence interval (default = TRUE).

IntPrev

Case TypeGraf = "Regression". Graphics with predictive interval (default = TRUE).

Casc

Cascade effect in the presentation of the graphics (default = TRUE).

Value

Returns several graphs.

See Also

Regr

Examples

Run this code
# NOT RUN {
data(DataMix)

Y <- DataMix[,2]

X <- DataMix[,7]

NomeY <- "Medium grade"

NomeX <- "Commercial coffees"

Res <- Regr(Y, X, NameVarX = NomeX , Intercepts = TRUE, SigF = 0.05)

Tit <- c("Scatterplot")
Plot.Regr(Res, TypeGraf = "Scatterplot", Title = Tit,
          NameVarY = NomeY, NameVarX = NomeX, Color = TRUE)

Tit <- c("Scatterplot with the adjusted line")
Plot.Regr(Res, TypeGraf = "Regression", Title = Tit, 
          xlabel = NomeX, ylabel = NomeY, Color = TRUE,
          IntConf = TRUE, IntPrev = TRUE)

dev.new() # necessary to not overlap the following graphs to the previous graph

par(mfrow = c(2,2)) 

Plot.Regr(Res, TypeGraf = "QQPlot", Casc = FALSE)
Plot.Regr(Res, TypeGraf = "Histogram", Casc = FALSE)
Plot.Regr(Res, TypeGraf = "Fits", Casc = FALSE)
Plot.Regr(Res, TypeGraf = "Order", Casc = FALSE)
# }

Run the code above in your browser using DataLab