Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: graphic
See also: svd grandrews grpcp grstar grsurface

Quantlet: grbiplot
Description: Generates a graphical object containing the coordinates for the biplot of a given matrix.

Reference(s):

Link:
Usage: b = grbiplot(x,r,k)
Input:
x n x p matrix, data (n >= p)
r scalar, rank of approximation (r <= p)
k scalar, 0 <= k <= 1
Output:
b (n+p) x r matrix, containing the coordinates for the biplot

Note:

Example:
library("graphic")
x = read("uscrime")			;; read US crime data
x=x[,3:(cols(x)-2)]
n = rows(x)
b = grbiplot(x, 2, 0.5)			;; create biplot graphical object
dat1 = b[1:n]
dat2 = b[(n+1):rows(b)]
d = createdisplay(1,1)
xrows= "ME"|"NH"|"VT"|"MA"|"RI"|"CT"|"NY"|"NJ"|"PA"|"OH"|"IN"|"IL"|"MI"
xrows = xrows|"WI"|"MN"|"IA"|"MO"|"ND"|"SD"|"NE"|"KS"|"DE"|"MD"
xrows = xrows|"VA"|"WV"|"NC"|"SC"|"GA"|"FL"|"KY"|"TN"|"AL"|"MS"|"AR"|"LA"|"OK"
xrows = xrows|"TX"|"MT"|"ID"|"WY"|"CO"|"NM"|"AZ"|"UT"|"NV"|"WA"|"OR"|"CA"|"AK"|"HI"
setmaskt(dat1,xrows,1,0,15)
xcols="mur"|"rap"|"rob"|"ass"|"bur"|"lar"|"aut"
setmaskp(dat1,0,0,0)
setmaskt(dat2,xcols,4,0,15)
setmaskp(dat2,0,0,0)
show(d,1,1,dat1, dat2)

Result:
shows a biplot of the US crime data. The states are labeled in blue
the crime type is labeled in red



Author: MD*Tech, 20021202 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006