[R] gamlss & multcomp

tdenes at cogpsyphy.hu tdenes at cogpsyphy.hu
Mon Jan 10 19:50:06 CET 2011

```Dear Experts,

We conducted an experiment with 2 within-subject factors. We have very
good reason to use gamlss, which works fine for our dataset, but
unfortunately in the final model the vcov matrix can not be produced. This
possibility is documented in the gamlss manual, but no hint is given how
to resolve the problem if multiple comparisons are needed. (Actually I
prefer building models with and without the given term and check the
information criteria or running likelihood-ratio tests, but reviewers on
my field do insist on such direct comparisons.)

Here I give you a short example (the actual design is far more
complicated, but the problem is essentially the same):

#############################
# EXAMPLE
#############################

library(gamlss)

# make it reproducable
set.seed(1234)

# define the subject factor and two within-subject factors
# (fa & fb, with 2 and 3 levels, respectively)
datfr <- expand.grid(subj=1:20,fa=0:1,fb=0:2)[rep(1:120,5),]

# define dependent variable
datfr\$y <- with(datfr,
rep(sample(rnorm(20,0,2)),30) +
fa*2+ifelse(fa==1,rnorm(600,0,2),rnorm(600,0,1)) +
fb*3+rnorm(600,0,fb) +
fa*fb*3)
datfr\$fa <- factor(datfr\$fa)
datfr\$fb <- factor(datfr\$fb)
datfr\$subj <- factor(datfr\$subj)

# our dataset is unbalanced, that's why
datfr <- datfr[sample(600,400),]

# gamlss model
m.gamlss <- gamlss(y~ fa*fb + random(subj),
sigma.fo= ~fa +fb, data=datfr)

summary(m.gamlss)

###############################

Regards,
Denes

```