plot.gcjc {grt} | R Documentation |
Plot Method for Class 'gcjc'
Description
Plot the fitted data set and decision boundary.
Usage
## S3 method for class 'gcjc'
plot(x, fitdb = TRUE, initdb = FALSE, xlim = NULL, ylim = NULL, bg, pch, ...)
Arguments
x |
object of class |
fitdb |
logical. If |
initdb |
logical. If |
xlim |
the x limits of the plot |
ylim |
the y limits of the plot |
bg |
the background color to be used for points. Default is |
pch |
the symbols to be used as points. Default is |
... |
further arguments. |
Details
This function produces a scatter plot of data matrix in the x
and (optionally) decision boundary specified within (i.e., x$par
and/or x$initpar
).
Examples
m <- list(c(100,200),c(100,100),c(200,100),c(200,200))
covs <- diag(30^2, ncol=2, nrow=2)
set.seed(1)
CJ <- grtrnorm(n=c(50,20,10,20), np=4, means=m, covs=covs)
CJ$category <- c(1,2,2,2)[CJ$category]
#create ramdom responses with 80% accuracy
CJ$response <- CJ$category
set.seed(1)
incorrect <- sample(1:100, size=20)
CJ$response[incorrect] <- abs(CJ$response[incorrect] - 3)
#now fit the model
m.cj <- gcjc(response ~ x1 + x2, data=CJ, config=2, category=CJ$category, zlimit=7)
plot(m.cj)
[Package grt version 0.2.1 Index]