[R] crossed random effects
spencer.graves at pdf.com
Wed Jul 2 02:07:26 CEST 2003
How many mum's and pop's do you have, and how many observations do
you have of each mum-pop combination? If you want mum nested within
pop, do I infer correctly that each mum has mated with only one pop, but
that each pop may have offspring by multiple mums? The table of mum-pop
combinations might help explain why you got, "Error in chol((value +
t(value))/2) : non-positive definite matrix in chol".
If you can get an answer ignoring pop, then you might be able to get
an answer with pop as a separate random term without specifying mum
nested within pop. Also, I'd check very carefully the specification of
nesting: I've messed that up more than once, and I'm bald now, because
I tore all my hair out before I figured out what I was doing wrong.
(Well, there is a slight exageration there.) Have you tried a very
simple toy problem (or a published example) with nesting to make sure
you can get the correct answer?
hope this helps.
Sarah Mclean wrote:
> thanks for the advice. I have looked at the Pinheiro
> and Bates book and I've tried simplifying my model.
> I've narrowed the problem down to having mum nested
> within pop. If I run the analysis on each population
> separately, the interaction between mo and su with mum
> works fine.
> If I could analyse all of the pops at once this would
> be preferable because I have multiple responses and
> pops to test so it would take a bit of time. I'm
> hoping there is any easier way.
> --- Spencer Graves <spencer.graves at PDF.COM> wrote: >
> Have you studied Pinhiero and Bates (2000) Mixed
>>Effects Models in S
>>and S-Plus (Springer)?
>> Also, have you tried simplifying your "lme" call
>>until you get
>>something that works, then start adding back terms
>>configurations until it breaks?
>> Have you tried to compute how many coefficients
>>are estimated in both
>>fixed and random terms and evaluate whether all are
>>example, with 2 factors at 2 levels each, if you
>>don't have all 4
>>possible combinations, you can't estimate the
>>interaction -- even if you
>>have thousands of replications of each.
>> Finally, you can always try to read the code.
>>I've learned a lot
>>about S-Plus / R by doing that -- and solved a lot
>>of my own problems
>>hope this helps. spencer graves
>>Sarah Mclean wrote:
>>>if I have posted this twice, please ignore this.
>>>not sure if I sent it to the correct e-mail
>>>the first time.
>>>I have a data set on germination and plant growth
>>>the following variables:
>>>sub (fixed effect)
>>>moist (fixed effect)
>>>pop (fixed effect)
>>>mum (random effect nested within population)
>>>plot (random effect- whole plot factor for
>>>I want to see if moist or sub interacts with mum
>>>any of the pops, but I am getting an error
>>>This is the formula I used:
>>>fm$pmu <- getGroups(fm, ~1|pop/mum, level=2)
>>>fm$grp = as.factor(rep(1,nrow(fm)))
>>>fm$pl <- getGroups(fm, ~1|plot)
>>>fm$mo <- getGroups(fm, ~1|moist)
>>>fm$su <- getGroups(fm, ~1|sub)
>>>>fm1 <- lme(sqrt(mass) ~ iheight + moist*sub*pop,
>>>1), pdIdent(~pmu - 1), pdIdent(~pmu:su - 1),
>>>pdIdent(~pmu:mo - 1)))))
>>>Error in chol((value + t(value))/2) : non-positive
>>>definite matrix in chol
>>>I know the problem is with the random interaction
>>>terms, but I don't know how to overcome this.
>>>Any advice would be greatly appreciated. I'm new
>>>and analysis such as this.
>>>sarahmclean9 at yahoo.co.nz
>>>http://mobile.yahoo.com.au - Yahoo! Mobile
>>>- Check & compose your email via SMS on your
>>Telstra or Vodafone mobile.
>>>R-help at stat.math.ethz.ch mailing list
> http://mobile.yahoo.com.au - Yahoo! Mobile
> - Check & compose your email via SMS on your Telstra or Vodafone mobile.
More information about the R-help