Obsidian | Level 7

## How to model time as a continuous variable in pre-post longitudinal data

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
SAS Super FREQ

## Re: How to model time as a continuous variable in pre-post longitudinal data

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;``````

Obsidian | Level 7

## How can I model two data points longitudinally?

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;``````

Discussion stats
• 2 replies
• 1150 views
• 2 likes
• 2 in conversation