[R-sig-ME] lme & lmer - weighting and multiple random effects
Clark Allan Dr (MED)
Allan.Clark at uea.ac.uk
Mon Oct 24 17:43:26 CEST 2011
Dear All,
I am having some problems running a network meta-analysis model using Lumley’s NMA code (Lumley T (2002) "Network meta-analysis for indirect treatment comparisons" Statistics in Medicine 21: 2313-2324):
I can run the fixed effects model using the code given in the paper using lme (data is at the bottom of the email):
fednmaresults <-lme(lor ~0 + nmatr1 + nmatr3 ,random= ~1|trtpair, data=fednmadat,weights=varConstPower(form=~var,fixed=list(power=1)))
which assumes that the effects of treatment 1 and treatment 3 (relative to treatment 2) are fixed, whereas there is a random effect for treatment pair (trtpair). However, when I try to run a random effects models I need to have two random effects one for the treatment pair comparison and another for the effect of treatment 1 and treatment 3. I couldn’t figure out how to do this using lme so I switched to lmer using the code
fednmaresults <-lmer(lor ~0 + nmatr1 + nmatr3+ (1|trtpair) + (nmatr1 + nmatr3|n.trials), data=fednmadat,weights=varConstPower(form=~var,fixed=list(power=1)))
which gives an error due to the weights not being valid for lmer. So I have two questions
a) Is it possible to use this kind of weighting in lmer?
b) Is it possible to specify multiple random effects using lme?
Any help greatly appreciated.
Best wishes,
Allan
Dr Allan Clark
University of East Anglia
Norwich
NR4 7TJ, UK
The (simulated) data is
nmatr1 nmatr3 trtpair var lor n.trials
[1,] 1 0 1 0.1227773 -0.06136895 1
[2,] 1 0 1 0.1302507 -0.13005313 2
[3,] 1 0 1 0.1332559 0.58192155 3
[4,] 1 0 1 0.1895425 -0.46262352 4
[5,] 1 0 1 0.1136106 -0.22631313 5
[6,] 1 -1 2 0.1121032 0.44183275 6
[7,] 1 -1 2 0.1169523 0.40404162 7
[8,] 1 -1 2 0.1214425 0.24169897 8
[9,] 1 -1 2 0.1158333 0.28768207 9
[10,] 1 -1 2 0.1151018 -0.17224590 10
[11,] 0 -1 3 0.1147403 -0.05735517 11
[12,] 0 -1 3 0.1291468 -0.31996089 12
[13,] 0 -1 3 0.1311490 -0.26070185 13
[14,] 0 -1 3 0.1207751 -0.12062799 14
[15,] 0 -1 3 0.1194390 -0.69024322 15
More information about the R-sig-mixed-models
mailing list