Dear All,

I have binary data (variable = wet) for 11,079 days (1st September 1969
- 31 December 1999) that takes the value 1 if the day was wet and 0
otherwise.

I want to fit a hierarchical model with days nested in years because I
have some covariates that vary on a daily basis and some that vary on an
annual basis.

I have two different variables that could be used to represent the level
2 groups.

The first is year - that represents the calendar year.

The second is season - this is the same as the variable year except it
starts on 1 July and runs until 30th June. This is useful because the
rainy season runs from October to February.

 

I get very different results for my random effects depending on whether
I use season or year.

 

*** If I fit season as my level 2 variable I get:

lmer0.season<-lmer(wet~1+(1|season),family=binomial)

I have 0 variance for my level 2 term

Random effects:

 Groups Name        Variance Std.Dev.

 season (Intercept)  0        0      

Number of obs: 11079, groups: season, 31

 

*** If I fit year as my level 2 variable:

lmer0.year <- lmer(wet~1+(1|year),family=binomial)

I get non-zero level 2 variance. The random effects for each year are
basically the proportion of the days in each year that are wet.

 

Random effects:

 Groups Name        Variance  Std.Dev.

 year   (Intercept) 0.0050641 0.071162

Number of obs: 11079, groups: year, 31

 

Does anyone know why this is happening? Am I doing something obviously
wrong?

For information I have included below the proportion of wet days in each
season and each year. You can see that they are not much different so I
am puzzled as to the difference in the answers and have now argued both
out as being right/wrong!

 

> round( tapply( wet, year, mean), 2)

1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
1983 

0.14 0.13 0.16 0.16 0.15 0.15 0.14 0.15 0.18 0.17 0.18 0.16 0.18 0.11
0.18 

1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997
1998 

0.18 0.15 0.11 0.12 0.13 0.13 0.16 0.17 0.15 0.14 0.14 0.12 0.15 0.16
0.14 

1999 

0.16 

 

> round( tapply( wet, season, mean),  2)

1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
1983 

0.14 0.14 0.16 0.18 0.12 0.17 0.12 0.18 0.18 0.16 0.17 0.18 0.15 0.14
0.16 

1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997
1998 

0.14 0.13 0.13 0.14 0.13 0.15 0.16 0.14 0.15 0.15 0.12 0.14 0.13 0.18
0.14 

1999 

0.13 

 

Thanks

Fiona

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dr Fiona M. Underwood

Lecturer in Applied Statistics

University of Reading, UK

e-mail: f.m.underwood@reading.ac.uk <mailto:f.m.underwood@reading.ac.uk>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 


	[[alternative HTML version deleted]]


