Hello all,
Based on the suggestions from my previous post on power and lme(), I built
a simulation model (Splus 2000 Professional, NLME 3.3.1). The details of
the model are below. Occassionally (~ 1/2000 simulations), the code gives
me some warnings and an error that I haven't seen before. In particular:
Warning messages:
Warning in .C("compSymm_factList",: log(0): SING error
Warning messages:
Warning in .C("compSymm_factList",: log(0): SING error
Warning messages:
Warning in .C("compSymm_recalc",: log(0): SING error
Warning messages:
Warning in .C("compSymm_recalc",: log(0): SING error
Error in .C("mixed_loglik",: subroutine mixed_loglik: 2 missing value(s)
in argument 1
Any thoughts on what might be going on and how to get around it?
THE MODEL: There is a random subject effect drawn from rnorm(0,sd.dev).
There are 5 observations per subject each time period, and total of 6
time periods. Observations between subjects are independent, observations
within subject are correlated across time periods with covariance
foo.cov. I generate observations for a subject across time using:
rmvnorm(5,mean=c(u1,u2,u3,u4,u5,u6), cov=tempcov)
where u1...u6 equals the grand mean plus treatment effect (if any) plus
random effect.
tempcov is a compound-symmetric variance-covariance matrix (a
constant foo.var on the diagonal and a constant foo.cov on the
off-diagonal) foo.var takes on values from (0.2*grand.mean)^2 to
(0.8*grand.mean)^2 over the range of simulations (constanst within a
simulation) and foo.cov takes on values of 0.25, 0.5, and 0.75 over the
range of simulations (constant within a simulation)
The rmvnorm command is run separately for each subject.
I fit the data using the equation:
foobar <- lme(fixed = my.rand.obs ~ Treatment , random = ~1|Subject, corr
= corCompSymm(form = ~1|Subject/Year),data = randdata, subset = control=
list(maxIter=400),na.action = na.exclude)
It strikes me as odd that it would generate and run ~2000 data sets and
then produce errors.
Thanks for your help!
Cheers,
Andy
******************************************************************
"What if the Hokey Pokey is all it really is about?" - Jimmy Buffett
Andrew B. Cooper, Ph.D.
Department of Natural Resources
Nesmith Hall, Rm 208A
University of New Hampshire
Durham, NH 03824
andrew.cooper@unh.edu
603.862.4254, 603.862.4976 (FAX)
http://www.unh.edu/natural-resources/fac-cooper.html
******************************************************************
On Thu, 16 Oct 2003, Andrew Cooper wrote:
>
> I would like to thank Maren Olsen, Pete Meyer, and Jake Bowers for their
> wonderful suggestions (copied below)! Given the number of responses
> saying, "I've been trying to figure this out, too, and would love to get
> an answer," I don't feel quite so bad about asking what I thought was a
> fairly naive question. :) Here are their suggestions. Thanks again!
>
> Cheers,
> Andy
>
> Suggestions:
>
> 1) Simulation with Splus - this isn't difficult to do, but you need to
> have very good pilot data - particularly or the variance components.
>
> 2) Approximation using GEE methods ... I've used approaches from two
> different papers
>
> Rochon, J. (1998). Application of GEE procedures for sample size
> calculations in repeated measures experiments. Statistics in Medicine,
> 17, 1643-1658.
> Note: you can email Jim Rochon directly for SAS code. He's now at Duke -
> his email address is: rocho001@mc.duke.edu
>
> Jung, Sin-Ho and Ahn, Chul. 2003. Sample size estimation for GEE method
> for comparing slopes in repeated measures data. Statistics in Medicine.
> 22:1305-1315.
> Note: you can just program the formulas yourself using Splus
>
> ------------------------------
>
> I don't have Splus code for it, but I used the formulas in Diggle, Liang
> and Zeger pages 27-32. It wouldn't be hard to program
>
> ------------------------------
>
> We have two kinds of software for Splus that deal with power and
> multilevel sample designs. The first piece of software merely implements
> code from Steve Raudenbush in Splus that provides analytical power
> calculations for a very simple sampling situation [one second level
> explanatory, no stratification].
>
> The direct link for Raudensbush's Optimal Design software (a stand along
> program available in binary form for Windows) is:
>
> http://www.ssicentral.com/other/hlmod.htm
>
> We also wrote our own code that uses simulation to provide a sense of the
> relative efficiency of more complicated multilevel sampling designs which
> involve stratification (both balanced and unbalanced).
>
> http://socrates.berkeley.edu/~stoker/sampledesign.html
>
>
> If you are willing to go beyond Splus, you might be interested in the PinT
> program (written for DOS) by Tom Snijders, Roel Bosker, and Henk
> Guldemond. It is also based on closed-form solutions. While it doesn't
> allow for direct specification of stratification, it does allow the
> inclusion of a cost function. See it here:
>
> http://stat.gamma.rug.nl/snijders/multilevel.htm#progPINT
>
>
>
>
> On Fri, 10 Oct 2003, Andrew Cooper wrote:
>
> >
> > Hello s-newsers,
> >
> > I've been looking high and lower for code to perform power and sample size
> > calculations for mixed-effects models. I've searched the s-news archives
> > and all I came up with was a post from 1998 from someone doing this with
> > simulations. Pinheiro and Bates (2000) do not seem to cover this, either
> > (or I might have just missed it).
> >
> > Does anyone out there know of any code (preferably Splus) to perform power
> > and sample size calculations for mixed-effects models?
> >
> > Thank you for your help!
> >
> > Cheers,
> > Andy
> >
>
|