caterplot.gls: Makes a caterpillar plot from a gls object

Description Usage Arguments Author(s) Examples

View source: R/MTfuncs_all.R

Description

Makes a caterpillar plot from a gls object. Plot shows estimates for each coefficient, plus 95% CI's for each, defined as +/- 2 se's

Usage

1
caterplot.gls(caterprep.out, which = -1, col.breaks = -1, colors = -1)

Arguments

caterprep.out

An object returned from caterprep.gls()

which

A vector of which elements to plot. A value of -1 specifies all but the intercept.

col.breaks

A vector of breakpoints in element numbers for each color, defined as the first element of a given color. If col=c(1,2,3) and col.breaks=c(1,4,9), then elements 1-3 get color 1, 4-8 get color 2, and 9-end get color 3.

colors

A vector of colors to use

Author(s)

Matt Tyers

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# ------- first some data ------ #
Factor <- sample(c("A","B","C","D"),1000,replace=T)
x <- 1:1000
means <- 2*x+1*(Factor=="A")+3*(Factor=="B")+4*(Factor=="C")+2*(Factor=="D")
y <- rnorm(1000,means,4)
library(nlme)
model <- gls(y~Factor*x)

# --------- now the function ---------- #
prep.out <- caterprep.gls(model)
caterplot.gls(prep.out)

mbtyers/MTfuncs documentation built on May 22, 2019, 12:58 p.m.