[R] negative variances
dimitris.rizopoulos at med.kuleuven.be
Wed Apr 11 14:57:21 CEST 2007
In fact this implies that random-effects might not be the way to go
for your data. When you're using random-effects the marginal
covariance matrix is of the form:
V = Z D Z^t + Sigma,
where Z is the design matrix for the random-effects, D their
covariance matrix and Sigma is the covariance matrix for the error
terms. If the correlation between the repeated measurements of your
sample units could be explain by a set of random-effects, then D
should be a positive definite matrix. However, note that V might be
positive definite even if D it is not, as in your case, which implies
that the assumption of some common random-effects that the sample
units share might not be valid.
Alternatively, you could model directly the marginal covariance matrix
V using the 'correlation' and 'weights' arguments of gls().
I hope it helps.
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
----- Original Message -----
From: "Tu Yu-Kang" <yukangtu at hotmail.com>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, April 11, 2007 12:34 PM
Subject: [R] negative variances
> Dear R experts,
> I had a question which may not be directly relevant to R but I will
> grateful if you can give me some advices.
> I ran a two-level multilevel model for data with repeated
> measurements over
> time, i.e. level-1 the repeated measures and level-2 subjects. I
> could not
> get convergence using lme(), so I tried MLwiN, which eventually
> showed the
> level-2 variances (random effects for the intercept and slope) were
> negative values. I know this is known as Heywood cases in the
> equation modeling literature, but the only discussion on this
> problem in
> the literature of multilevel models and random effects models I can
> find is
> in the book by Prescott and Brown.
> Any suggestion on how to solve this problem will be highly
> Many thanks.
> With best regards,
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help