Learn R Programming

rockchalk (version 1.4)

mcGraph1: Illustrate the effect of multicollinearity in regression.

Description

This is a set of functions that faciliates the examination of multicollinearity. Suppose the "true" relationship is y[i] = 0.2 * x1[i] + 0.2 * x2[i] + e where e is Normal(0, stde^2).

Usage

mcGraph1(x1, x2, y, x1lab, x2lab, ylab, ...)

Arguments

x1
a predictor vector
x2
a predictor vector
y
the dependent variable
x1lab
label for the x1 axis, (the one called "xlab" inside persp)
x2lab
label for the x2 axis, (the one called "ylab" inside persp)
ylab
label for the y (vertical) axis (the one called "zlab" inside persp)
...
additional parameters passed to persp

Examples

Run this code
set.seed(12345)
## Create data with x1 and x2 correlated at 0.10
dat <- genCorrelatedData(rho=.1, stde=7)

mcGraph1(dat$x1, dat$x2, dat$y, theta=20, phi=8, ticktype="detailed", nticks=10)

Run the code above in your browser using DataLab