tukeytrendformula: Fit multiple marginal models with differently re-scaled dose...

Description Usage Arguments Value Author(s) References Examples

View source: R/tukeytrendformula.R

Description

Wrapper function to fit a given model after different rescalings of a single dose variable. The fitted models are combined into a list that is suitable as input to the multiple marginal model function of package multcomp, mmm.

Usage

1
2
3
tukeytrendformula(formula, data, model = "lm", dose,
scaling = c("ari", "ord", "log", "arilog", "treat", "treatHL"),
ctype = NULL, ddf = c("residual", "KR", "PB"), d0shift = 1, ...)

Arguments

formula

formula object suitable for the model function specified in model, the left hand side of the formual should contain at least one (numeric) variable, that is to be re-scaled in the model fits

data

data.frame containing the variables of interest

model

character string, naming the function for model fitting, currently "lm", c"glm", "lmer", "lme" are supported

dose

A single character string, naming a numeric variable in the models formula. This variable is rescaled acc. to the options in scaling and the model in fit is then refitted with the rescaled dose variable.

scaling

A vector of character strings, naming the options for rescaling the variable specified in dose: "ari": no rescaling, "ord": ranks of dose levels, "log": log-transformed dose levels, "arilog": log-transformned dose levels, with interpolated dose score for 0, "high.vs.low": dose coerced to a factor, and only highest and lowest dose level retained, all others set NA, "treat": dose coerced to a factor, all levels retained with the option to apply multiple contrast tests to the treatment levels

ctype

optional character string naming a contrast type for multiple comparisons between dose levels, when scaling="treat". Options are "Dunnett", "William" etc., see ?contrMat in package multcomp. Argument ctype is ignored if scaling does not involve option "treat".

ddf

single character string, defining the option for the degree of freedom in inference after model fitting. By default, "residual" degrees of freedom will be used for all models. "KR": For models of class "lmerMod" (fitted by "lmer" from package "lme4"), Kenward-Roger degrees of freedom can be computed (based on methods from package "pbkrtest"); "PB": For models of class "lme" (fitted by "lme" from package "nlme"), containment degrees of freedom as defined by Pinheiro and Bates can be extracted.

d0shift

an optional factor, that is multiplied with the interpolated dose score for dose = 0 in option scaling="arilog"; ignored in all other options for rescaling

...

arguments passed to the model fitting function named in model

Value

A list with elements

mmm

a list of fitted models, after rescaling the dose variable

mlf

a list of matrices defining a linear functions of model parameters for each model in mmm, defining the parameter of interest for inference in function mlf and glht

df

a vector of degrees of freedom, one for each model in mmm

and information of the model type and call of the initial model

Author(s)

Frank Schaarschmidt and Christian Ritz (providing internal functions to interface objects of class "lmerMod" and "lme")

References

Tukey JW, Ciminera JL, Heyse JF (1985). Testing the statistical certainty of a response to increasing doses of a drug. Biometrics 41(1), 295-301.

Pipper CB, Ritz C, Bisgaard H (2012). A versatile methode for confirmatory evaluation of the effects of a covariate in multiple models. JRSSC - Applied Statistics 61, 315-326.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(litter, package="multcomp")

# compare

dl <- litter
dl$dosen <- as.numeric(as.character(dl$dose))

ttlitter <- tukeytrendformula(weight ~ dosen + number, data=dl, model="lm", dose="dosen", 
 scaling=c("ari", "ord", "log", "treat"), ctype="Dunnett")

summary(asglht(ttlitter))

tukeytrend documentation built on March 13, 2020, 5:06 p.m.