Learn R Programming

mcprofile (version 0.0-9)

mcpcalc: Construction of Multiple Contrast Profiles

Description

Calculates signed root deviance profiles given a glm or lm object. The profiled parameters of interest are defined by providing a contrast matrix. The functions handling lmer and nls objects is only experimental; please handle with care.

Usage

## S3 method for class 'lm':
mcpcalc(object, CM, control=mcprofileControl(), margin=NULL, method="BFGS")
## S3 method for class 'glm':
mcpcalc(object, CM, control=mcprofileControl(), margin=NULL, method="BFGS")
## S3 method for class 'nls':
mcpcalc(object, CM, control=mcprofileControl(), margin=NULL, method="BFGS")
## S3 method for class 'mer':
mcpcalc(object, CM, control=mcprofileControl(), margin=NULL, method="BFGS")

Arguments

object
An object of class glm or lm
CM
A contrast matrix with the number of columns equal the number of estimated parameters. Contrast coefficients should be -1 and 1, respectively. Providing row names is recommendable.
control
A list with control arguments. See mcprofileControl.
margin
Numeric vector of margins, defining the profiling range. If NULL no extra margin is considered.
method
"IRWLS", "BFGS"

Value

Details

According to the rows of a contrast matrix the design matrix of a model is restructured by makeDesign. The parameter of interest is then profiled as in function profile.glm or profile.nls. The signed root deviance is calculated and interpolated by interpolation splines.

See Also

profile.glm, profile.nls, glht, interpSpline, contrMat

Examples

Run this code
#######################################
## cell transformation assay example ##
#######################################

str(cta)
boxplot(foci ~ conc, cta, xlab="concentration", col="lightgreen")
## change class of cta$concentration into factor
cta$concf <- factor(cta$conc, levels=unique(cta$conc))

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

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

# calculating signed root deviance profiles
(dmcp <- mcpcalc(fm, CM, method="IRWLS"))
# plot profiles
plot(dmcp)

# multiplicity adjusted p-values
(adjpv <- test(dmcp,adjust="single-step",alternative="two.sided",margin=0))
plot(adjpv, alpha=0.05, order=FALSE)
plot(dmcp, adjpv)

# simultaneous confidence intervals
(ci <- confint(dmcp, adjust="single-step"))
# exponent of confidence limits --> ratio of group means
exp(ci)

plot(exp(ci))
abline(v=1, lty=2)

plot(dmcp, ci)

Run the code above in your browser using DataLab