Learn R Programming

clogitL1 (version 1.5)

plot.clogitL1: Plotting after fitting conditional logistic regression with elastic net penalties

Description

Takes a clogitL1 object and plots the parameter profile associated with it.

Usage

# S3 method for clogitL1
plot (x, logX=T,
	add.legend=F, add.labels=T,
 	lty=1:ncol(x$beta), col=1:ncol(x$beta), ...)

Arguments

x

an object of type clogitL1.

logX

should the horizontal axis be on log scale?

add.legend

set to TRUE if legend should be printed in top right hand corner. Legend will contain names of variables in data.frame, if specified, otherwise will be numbered from 1 to p in order encountered in original input matrix x

add.labels

set to TRUE if labels are to be added to curves at leftmost side. If variable names are available, these are plotted, otherwise, curves are numbered from 1 to p in order encountered in original input matrix x

lty

usual 'lty' plotting parameter.

col

usual 'col' plotting parameter.

...

additional arguments to plot function

References

http://www.jstatsoft.org/v58/i12/

See Also

clogitL1

Examples

Run this code
# NOT RUN {
set.seed(145)

# data parameters
K = 10 # number of strata
n = 5 # number in strata
m = 2 # cases per stratum
p = 20 # predictors

# generate data
y = rep(c(rep(1, m), rep(0, n-m)), K)
X = matrix (rnorm(K*n*p, 0, 1), ncol = p) # pure noise
strata = sort(rep(1:K, n))

par(mfrow = c(1,2))
# fit the conditional logistic model
clObj = clogitL1(y=y, x=X, strata)
plot(clObj, logX=TRUE)

# cross validation
clcvObj = cv.clogitL1(clObj)
plot(clcvObj)
# }

Run the code above in your browser using DataLab