Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: negative variance?

From   Maarten Buis <>
Subject   Re: st: negative variance?
Date   Tue, 25 Jun 2013 13:40:00 +0200

Before trying anything fancy, I would first make sure that all the
explanatory variables have the value 0 at a reasonable point within
the range of the data. Often people choose the mean, which is an ok
default but not a necessary choice. For example, when one has years of
education in the US system it may make more sense to center at 12
years of education (high school) rather than the mean.

The logic behind this advise is that random effects models add one or
more extra models for the constant. Finding reasonable estimates is a
lot easier if that constant is something that is within the range of
the data. For example if one of the variables is year of birth, than
the constant would refer to someone born in the year 0, which is often
an extreme extrapolation. In the kind of datasets I have it often
makes sense the create a new variable like so -gen c_byr = (byr -
1950) / 10-, i.e. c_byr is year of birth in decades since 1950 (1950
is typically well within the range of my data, but that obviously does
not have to be true for other datasets).

Hope this helps,

On Tue, Jun 25, 2013 at 1:11 PM, Hanne F <> wrote:
> Hi,
> I am currently using a two-level random slope model, logistic regression.
> The reason I use multilevel is to control for a possible design effect. I am
> using xtmelogit, but I already tried glamm and xtlogit as well. I have data
> for three measurements. When running the same model on the first two
> measurements, I do not experience any problems. By contrast, for the third
> measurement, I do not seem to get an accurate estimation of the second level
> variance. Sd_cons is virtually zero, and the confidence interval is also
> odd: I get exactly 0 as a lower point, and a '.' as upper bound. The p-value
> indicating whether or not it is necessary to use a multilevel design gives
> exactly zero. Can anyone tell me why this is the case?
> In a multilevel course based on MLWin I learned that in this case you should
> 'allow for negative variance'. Can anybody please tell me how I could do
> this with Stata?
> thank you very much in advance!!
> best regards,
> Hanne
> --
> View this message in context:
> Sent from the Statalist mailing list archive at
> *
> *   For searches and help try:
> *
> *
> *

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index