Pyrite | Level 9

## Longitudinal study - how to plot the outcome with CI against time

Hello, everyone

Today I read this research paper "Plozasiran (ARO-APOC3) for Severe Hypertriglyceridemia
The SHASTA-2 Randomized Clinical Trial" (doi:10.1001/jamacardio.2024.0959).

I am very interested in the line of Figure 2. According to my understanding, the model used in this research probably is a linear mixed model, and follow-up time is an independent factor. What I am not sure is how the author estimated the confidence interval of the outcomes in Figure 2? Using the linear mixed model? Or other methods?

Figure 2

Figure 2

9 REPLIES 9
Super User

## Re: Longitudinal study - how to plot the outcome with CI against time

Check @Rick_SAS blogs:

https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html

``````data have;
call streaminit(123);
do subject=1 to 100;
do time=1 to 10;
sex=ifc(rand('bern',0.4),'F','M');
weight=rand('normal',4,100);
height=rand('normal',0,2);
output;
end;
end;
run;

proc mixed data=have;
class  subject sex time;
model weight=height sex time/s;
random int/subject=subject;
repeated time/subject=subject ;
store out=mixedmodel;
run;
proc plm source=mixedmodel;
effectplot INTERACTION(x=time  sliceby=sex /*plotby=CigsPerDay*/ )/limits connect;
run;``````

Pyrite | Level 9

## Re: Longitudinal study - how to plot the outcome with CI against time

@Ksharp Hello, Ksharp. Thank you for your answer. Would you mind if you tell me whether it is appropriate to use only one of the random and repeated statements?

I think either the random or repeated statement can adjust the intra-individual relationship.

Tom

Super User

## Re: Longitudinal study - how to plot the outcome with CI against time

Yes. You can. But you have to have TIME variable in MODEL to plot the interaction graph.
Pyrite | Level 9

## Re: Longitudinal study - how to plot the outcome with CI against time

One more thing, I am thinking of what the codes should be if the response variable is not continuous (e.g., weight) but binary (e.g., event present). In this case, individuals are repeatedly measured to collect their status of the binary response variable and we would like to have a similar series graph. The x-axis remains the sequence of the repeated measurement, but the y-axis represent the risk (i.e., proportion) for the event to occur, along with its confidence interval.

Many thanks.

Tom

Super User

## Re: Longitudinal study - how to plot the outcome with CI against time

If your Y variable is a binary variable,you could use PROC GLIMMIX instead of PROC MIXED.

``````data have;
call streaminit(123);
do subject=1 to 10;
do time=1 to 5;
y=rand('bern',0.8);
sex=ifc(rand('bern',0.4),'F','M');
weight=rand('normal',4,100);
height=rand('normal',0,2);
output;
end;
end;
run;

/*Take TIME as R side random effect */
proc glimmix data=have;
class  subject sex time;
model y=height sex time/solution dist=binary ;
random int/subject=subject;
random time/subject=subject residual;
store out=mixedmodel;
run;
proc plm source=mixedmodel;
effectplot INTERACTION(x=time  sliceby=sex /*plotby=CigsPerDay*/ )/limits connect;
run;``````

``````

/*Take TIME as G side random effect */
proc glimmix data=have;
class  subject sex ;
model y=height sex time/solution dist=binary ;
random int time/subject=subject;
store out=mixedmodel;
run;
proc plm source=mixedmodel;
effectplot slicefit(x=time  sliceby=sex /*plotby=CigsPerDay*/ )/limits ;
run;``````

Pyrite | Level 9

## Re: Longitudinal study - how to plot the outcome with CI against time

What will happen if we treat the variable of time as a category variable in the class statement? Here, the time we use is not a continuous variable. Instead, it's a proxy of the number of a series of repeated measurements. For example, we monitor the individuals and we test their blood several times during the following period. Thx.
Super User

## Re: Longitudinal study - how to plot the outcome with CI against time

Check my code
/*Take TIME as R side random effect */
..........
Pyrite | Level 9

## Re: Longitudinal study - how to plot the outcome with CI against time

NOTE: An R-side variance component is confounded with the profiled variance.
NOTE: The GLIMMIX procedure is modeling the probability that inr_attain='1'.
NOTE: Did not converge.
NOTE: The GLIMMIX procedure deleted the model item store WORK.MIXEDMODEL because of incomplete information for a subsequent
analysis.

Problem with the raw data?

Super User

## Re: Longitudinal study - how to plot the outcome with CI against time

Yes.
NOTE: Did not converge.
it stands for your model is not right or trust .
Change your model syntax or Check the data.
Discussion stats
• 9 replies
• 633 views
• 2 likes
• 2 in conversation