Library: | graphic |
See also: | grsurface grlinreg grcontour2 |
Quantlet: | grlinreg2 | |
Description: | generates a graphical object which contains a linear regression plane from the data. The plane is computed on a rectangular grid with n^2 meshes. |
Usage: | gl = grlinreg2 (x, {n, {col}}) | |
Input: | ||
x | m x 3 matrix | |
n | 2 x 1 matrix | |
col | color | |
Output: | ||
gl | composed graphical object |
library("graphic") x = normal(100,2) y = 3*x[,1]+5*x[,2]+normal(100) l = grlinreg2(x~y) d = createdisplay(1,1) show(d,1,1,x~y,l)
shows the data and the linear regression plane