[R-sig-ME] Repeated measures design in R
Ben Bolker
bolker at ufl.edu
Sun Feb 14 20:58:32 CET 2010
Your design looks reasonable. Convergence failures usually have
something to do with weak identifiability -- not quite enough
information in the data to fit the model. It's hard to tell from
just the time-1 data you've presented here. It does look like the
data are a bit non-normal, although not terribly extremely. I don't
know if you really need a continuous-time correlation model (corCAR1);
are your data irregularly sampled in time? corAR1 might be better ...
You might also try assuming independence between the time and intercept
random effects (see Pinheiro and Bates 2000) to squeeze out a tiny bit
more model-fitting capability. The other extreme is to go to a Bayesian
approach which uses a mildly informative prior to stabilize the fitting ...
Manuel Spínola wrote:
> Dear list members,
>
> Sorry for cross-posting.
>
> I am analyzing a repeated measure design with the nlme package to assess
> the disease rate in 48 counties (localidad). The disease rate was
> measured in 4 consecutive years. The first 20 observations of my data
> set looks like:
>
> > ipa
> localidad tiempo ipa
> 1 15.MILLAS 1 123.40
> 2 23.MILLAS 1 185.40
> 3 24.MILLAS 1 21.31
> 4 25.MILLAS 1 0.00
> 5 26.MILLAS 1 59.11
> 6 28.MILLAS 1 10.28
> 7 4.MILLAS 1 118.69
> 8 7.MILLAS 1 17.09
> 9 AGRODISA 1 59.49
> 10 ASELICA 1 50.98
> 11 BALTIMORE 1 25.10
> 12 BANANITA 1 19.30
> 13 BANASOL 1 0.00
> 14 BARBILLA 1 27.33
> 15 BATAN 1 48.58
> 16 B.LINE 1 57.97
> 17 BOSTON 1 101.32
> 18 BRISTOL 1 47.62
> 19 COLONIA.PURISCALEÑA 1 22.22
> 20 CORINA 1 22.22
>
>
> I tried these models:
>
>
> # Pooled data
>
> modelo1 = glm(ipa ~ tiempo, family=gaussian(link=identity), data=ipa)
> summary(modelo1)
>
> # Parallel slopes
>
> modelo2 = glm(ipa ~ tiempo + localidad, family=gaussian(link=identity),
> data=ipa)
> summary(modelo2)
>
> # Random intercept (el intercepto cambia para cada localidad)
>
> modelo3 = lme(ipa ~ tiempo, random = ~ 1 | localidad, data=ipa)
> summary(modelo3)
>
> # Random intercept and slope
>
> modelo4 = lme(ipa ~ tiempo, random = ~ tiempo | localidad, data=ipa)
> summary(modelo4)
>
> # Autocorrelation
>
> modelo6 = lme(ipa ~ tiempo, random = ~ 1 | localidad, correlation =
> corCAR1(form = ~ tiempo | localidad), data=ipa)
> summary(modelo6)
>
>
> The model for Random intercept and slope gave me this error:
>
> > modelo4 = lme(ipa ~ tiempo, random = ~ tiempo | localidad, data=ipa)
> Error en lme.formula(ipa ~ tiempo, random = ~tiempo | localidad, data =
> ipa) :
> nlminb problem, convergence error code = 1
> message = iteration limit reached without convergence (9)
>
> Do you know why the model (modelo4) has problems?
>
> Also, is this the way to analyze a repeated measure design in R?
>
> The counties (localidad) are all the county that I am interested, is
> that still random factor?
>
> Thank you very much in advance.
>
> Best,
>
> Manuel Spínola
>
--
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
bolker at ufl.edu / people.biology.ufl.edu/bolker
GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc
More information about the R-sig-mixed-models
mailing list