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

# Re: st: Mixed model for longitudinal data: Time discrete or continuous?

 From David Hoaglin <[email protected]> To [email protected] Subject Re: st: Mixed model for longitudinal data: Time discrete or continuous? Date Mon, 4 Jun 2012 10:41:49 -0400

```Hi, Abdelouahid.

Using time as a continuous variable assumes that the contribution of
time (adjusting for the contribution of group) is linear.

If you fit the model in which time is categorical, you can then
examine the relation between the coefficients for the four categories
(taking 0 as the coefficient for time = 0) and assess whether the
pattern is linear.  Similarly for the coefficients for the interaction
between group and time.

If the pattern is not linear, adding a quadratic term should not be an
automatic choice.  That is only one pattern of nonlinearity, and it
may not be suitable (or even a reasonable approximation) in your data.

A more-formal approach would ask how much better the categorical-time
model fits than the linear-time model.

David Hoaglin

On Fri, Jun 1, 2012 at 5:52 AM, Abdelouahid Tajar <[email protected]> wrote:
> Hi,
>
>
>
> For mixed models (using xtmixed, xtlogit ect...) with
> longitudinal data in the standard situation with two covariates: time (0,1,2,3)
> (as an example) and a binary variable (0,1) for group.
>
> People often use time as a CONTINUOUS variable.
>
>
>
> In models which include an interaction term between time and group (which often
> is the case) we have three fixed effect parameters b1=time, b2=group and
> b3=interaction_time_group.
>
>
>
> Now if time is treated as DISRETE
> with time (0,1,2,3) we have 7 parameters: 1 for group,  3 for the 3
> dummies of time and the 3 for interaction terms between time and group.
>
>
>
> Compared to the model with discrete time, the model with time as continuous
> (which could also have a time^2 term) has clearly fewer parameters even when
> time^2 is included.
>
>
>
> My question is how to choose between the two models? The continuous time model and
> discrete time model?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```