Learn R Programming

BTLLasso (version 0.1-2)

ci.BTLLasso: Plot confidence intervals for BTLLasso

Description

Plots confidence intervals for every single coefficient. Confidence intervals are separated by covariates, every covariate is plotted separately. Confidence intervals are based on bootstrap, performed by boot.BTLLasso.

Usage

ci.BTLLasso(object, subs = NULL, rows = NULL, subset = NULL)

Arguments

object
boot.BTLLasso object
subs
Optional vector of subtitles for the single plots. Can be used to note the encoding of the single covariates, especially for dummy variables.
rows
Optional argument for the number of rows,
subset
Optional argument if only a subset of the covariates should be plotted. Vector specifying the numbers of the covariates that should be plotted.

References

Schauberger, Gunther and Tutz, Gerhard (2015): Modelling Heterogeneity in Paired Comparison Data - an L1 Penalty Approach with an Application to Party Preference Data, Department of Statistics, LMU Munich, Technical Report 183

See Also

boot.BTLLasso, BTLLasso, cv.BTLLasso

Examples

Run this code
## Not run: 
# # load data set
# data(GLESsmall)
# 
# # define response and covariate matrix
# X <- scale(GLESsmall[, 11:14])
# Y <- as.matrix(GLESsmall[, 1:10])
# 
# # vector of subtitles, containing the coding of the single covariates
# subs <- c("(in years)","female (1); male (0)",
# "East Germany (1); West Germany (0)","(very) good (1); else (0)")
# 
# # vector of tuning parameters
# lambda <- exp(seq(log(31),log(1),length=50))-1
# 
# # compute 10-fold cross-validation
# set.seed(5)
# m.cv <- cv.BTLLasso(Y = Y, X = X, folds = 10, lambda = lambda, cores = 10)
# 
# # plot covariate paths, together with cv-optimal model
# paths(m.cv)
# 
# # plot parameter paths, together with cv-optimal model
# singlepaths(m.cv, subs = subs)
# 
# # compute bootstrap confidence intervals
# m.boot <- boot.BTLLasso(m.cv, B = 100, cores = 25)
# 
# # plot bootstrap confidence intervals
# op <- par(no.readonly = TRUE) 
# par(mar=c(5,5,4,3))
# ci.BTLLasso(m.boot, subs = subs)
# 
# par(op)
# ## End(Not run)

Run the code above in your browser using DataLab