Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to model time as a continuous variable in pre-post longitudinal da...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-07-2020 02:34 PM
(1149 views)

I have a research question where I wanted to investigate factors predicting a change in a severity score of a lung health indicator (let's call it Y). I have two measurements which are unequally spaced, with subjects having an average follow-up 7.7 years; but some subjects have a follow-up period of 5 years and others close 9 years. I have covariates that are 'fixed' (e.g. sex, race) and others that are collected at each of the two time points (e.g. bmi).

**My question is: how can I best model the outcome of interest Y?**

If I am correct, I don't think I should worry about the co-variance structure in the model or 'random' time effects since I only have two time points. However, I think it is important to take into account that not all subjects have the same follow-up time (and perhaps treat time as continuous?).

I have tried the following with SAS code, but here I treated time as a categorical variable (0/1) -- which I believe is not correct since not everyone has the same follow-up time.

```
proc mixed data=data_long;
class id sex time;
model Y = time sex bmi time*bmi;
repeated time / type = un sub=id;
*lsmeans time*bmi;
run;
```

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I don't know the "best" way to model your data, but if you put TIME on the CLASS statement, the procedure will treat it as a categorical variable with the levels in the data. That likely means that the CLASS levels are not two, but are many.

See the MIXED doc for an example of continuous time. You can try removing that variable from the CLASS and REPEATED statements and see if the results make sense for your data

```
proc mixed data=data_long;
class id sex ;
model Y = time sex bmi time*bmi;
repeated / type = un sub=id;
run;
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I have a research question where I wanted to investigate factors predicting a change in a severity score of a lung health indicator (let's call it Y). I have two measurements which are unequally spaced, with subjects having an average follow-up 7.7 years; but some subjects have a follow-up period of 5 years and others close 9 years. I have covariates that are 'fixed' (e.g. sex, race) and others that are collected at each of the two time points (e.g. bmi).

**My question is: how can I best model the outcome of interest Y?**

If I am correct, I don't think I should worry about the co-variance structure in the model or 'random' time effects since I only have two time points. However, I think it is important to take into account that not all subjects have the same follow-up time (and perhaps treat time as continuous?).

I have tried the following with SAS code, but here I treated time as a categorical variable (0/1) -- which I believe is not correct since not everyone has the same follow-up time.

```
proc mixed data=data_long;
class id sex time;
model Y = time sex bmi time*bmi;
repeated time / type = un sub=id;
*lsmeans time*bmi;
run;
```

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.