getContrasts: Read and format contrast tables from Excel

Description Usage Arguments Value Author(s) See Also Examples

Description

Reads contrast from an Excel file for use with estimable of package gmodels.

Usage

1
2
3
getContrasts(cname, excelfile, rows = NULL)

readContrasts(cname, excelfile)

Arguments

cname

Sheet name in Excel file

excelfile

path of Excel file with contrast table

rows

optionally only select some rows of the table

Value

readContrasts read a contrast table. Only columns with at least on period in the header are kept. getContrasts additionally includes column and row name information to label contrast tables with estimable (gmodels)

Author(s)

Dieter Menne, dieter.menne@menne-biomed.de

See Also

See constrast.xlsx in the extdata directory for some rules of thumb on constructing a contrast matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(nlme)
library(gmodels)
options(digits=3)
set.seed(4711)
excelfile = system.file("extdata", "contrasts.xlsx", package = "Dmisc2")
d = expand.grid(subject = LETTERS[1:8],
                peri= c("Wine", "Tea"),
                post = c("Water", "Kirsch"),
                interval = c("Pre", "Post"))
d$vol = round(rnorm(nrow(d),10,2),1)
d.lme = lme(vol~interval+peri+post+peri:interval+interval:post,
            data=d,random=~1|subject)
summary(d.lme)
ct = getContrasts("peripostinterval",excelfile)
estimable(d.lme,ct,conf.int=0.95)

dmenne/dmisc2 documentation built on Sept. 30, 2019, 9:41 a.m.