Skip to content
Prev 15046 / 20628 Next

How does lmer treat a date.format (as.Date) variable?

Dear R project team,
I have been working for a while with lmer (lme4) and I have a question
please. I don't fully understand yet how does lmer treat a random variable
in a date format (as.Date).
This is the model syntax:

Y~X+(1+X|date)

I compared model results based on the same dataset just each time (model) I
changed the date variable format (i.e. as.factor, as.numeric, as.Date) and
received different results, while the best results were obtained when the
date was in a date.format.

I would highly appreciate your clarification for the differences between
the three formats in lmer.

Thank you very much in advance


*Meytar Sorek-Hamer*, NPP Research Fellow (USRA)
Earth System Science, Atmospherics
NASA Ames Research Center
Building 245, Room: 280L
Moffett Field, CA 94035  USA
ph: 650-604-0153  cell: 669-264-8000