Learn R Programming

grt (version 0.1-2)

coef.glc: Extract glc coefficients

Description

Extracts the coefficients from the model object glc or glcStruct.

Usage

## S3 method for class 'glc':
coef(object, \dots)

## S3 method for class 'glcStruct': coef(object, \dots)

Arguments

object
object of class glc or glcStruct
...
further arguments

Details

Both the object glc and glcStruct contain the parameters for the decision boundary in the form: $$a_1x_1 + a_2x_2 \ldots a_nx_n + b = 0$$

This function transforms and returns the coefficients of the function solved with respect the $x_n$.

Examples

Run this code
data(subjdemo_2d)
fit.2dl <- glc(response ~ x + y, data=subjdemo_2d,
    category=subjdemo_2d$category, zlimit=7)
plot(fit.2dl, fitdb=FALSE)
abline(coef(fit.2dl), col = "red")
abline(coef(fit.2dl$initpar))

fit.1dx <- update(fit.2dl, . ~ . -y)
abline(v=coef(fit.1dx), col="green")

fit.1dy <- update(fit.2dl, . ~ . -x)
abline(h=coef(fit.1dy), col="blue")

Run the code above in your browser using DataLab