Construction of Multiple Contrast Profiles

Share:

Description

Calculates signed root deviance profiles given a glm or lm object. The profiled parameters of interest are defined by providing a contrast matrix.

Usage

1
2
3
4
5
mcprofile(object, CM, control = mcprofileControl(), grid=NULL)
## S3 method for class 'lm'
mcprofile(object, CM, control=mcprofileControl(), grid=NULL)
## S3 method for class 'glm'
mcprofile(object, CM, control=mcprofileControl(), grid=NULL)

Arguments

object

An object of class glm or lm

CM

A contrast matrix for the definition of parameter linear combinations (CM %*% coefficients(object)). The number of columns should be equal to the number of estimated parameters. Providing row names is recommendable.

control

A list with control arguments. See mcprofileControl.

grid

A matrix or list with profile support coordinates. Each column of the matrix or slot in a list corresponds to a row in the contrast matrix, each row of the grid matrix or element of a numeric vector in each list slot corresponds to a candidate of the contrast parameter. If NULL (default), a grid is found automatically similar to function profile.glm.

Details

The profiles are calculates separately for each row of the contrast matrix. The profiles are calculated by constrained IRWLS optimization, implemented in function orglm, using the quadratic programming algorithm of package quadprog.

Value

An object of class mcprofile. The slot srdp contains the profiled signed root deviance statistics. The optpar slot contains a matrix with profiled parameter estimates.

Author(s)

Daniel Gerhard

See Also

profile.glm, glht, contrMat, confint.mcprofile, summary.mcprofile, solve.QP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#######################################
## cell transformation assay example ##
#######################################

str(cta)
## change class of cta$conc into factor
cta$concf <- factor(cta$conc, levels=unique(cta$conc))

ggplot(cta, aes(y=foci, x=concf)) + 
   geom_boxplot() +
   geom_dotplot(binaxis = "y", stackdir = "center", binwidth = 0.2) +    
   xlab("concentration")
   

# glm fit assuming a Poisson distribution for foci counts
# parameter estimation on the log link
# removing the intercept
fm <- glm(foci ~ concf-1, data=cta, family=poisson(link="log"))

### Comparing each dose to the control by Dunnett-type comparisons
# Constructing contrast matrix
library(multcomp)
CM <- contrMat(table(cta$concf), type="Dunnett")

# calculating signed root deviance profiles
(dmcp <- mcprofile(fm, CM))
# plot profiles
plot(dmcp)
# confidence intervals
(ci <- confint(dmcp))
plot(ci)