Hello all,

I am creating a marginsplot from my data of a mixed effects regression model. I am trying to prevent the appearance of a connecting line between values for time point 0 and time point 2 on my plot. The rest of the points (2 to 6; 6 to 12; 12 to 26; 26 to 52) should be connected. I have included an example of what I am trying to do in an image attached (https://jama.jamanetwork.com/article...jama.2018.6452)

I have read a fair amount about the connectstyle and connect_options, but these seem to only work for the plot globally rather than on individual time point to time point.

Thanks for your help.

Array

Code:
bootstrap: xtmixed eqvasfinal  i.random#time || participant_id:
margins time, by(i.random)
marginsplot, xdimension(time) scheme(lean2) plotopts(connect(i)))
Data example
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float eqvasfinal byte random float time int participant_id
 96 1 52  1
 66 1  2  1
 92 1  0  1
 90 1  6  1
  . 0  2  9
 93 0  0  9
  . 0 52  9
 80 0  6 13
 91 0 26 13
 95 0 12 13
100 0 52 13
 86 0  0 13
 64 0  2 13
 64 0  6 16
 95 0  0 16
 65 0  2 16
 98 0 52 16
 80 0 12 16
 62 1  2 27
100 1 52 27
 91 1  0 27
 80 1  6 27
 70 1 12 27
 90 1 26 27
 92 0  0 28
100 0 52 28
 80 0 12 28
 80 0  6 28
 90 0 26 28
 65 0  2 28
 70 0  2 31
 94 0  0 31
 95 0 52 31
 52 0 12 31
 76 0  6 31
 92 1 12 34
 99 1 52 34
 93 1 26 34
 65 1  2 34
 92 1  0 34
100 1 52 37
 51 1  6 37
 90 1 26 37
 90 1 12 37
 92 1  0 37
 65 1  2 37
 91 0 52 38
 70 0  6 38
 60 0 26 38
 95 0  0 38
end
label values random randomlabel
label def randomlabel 0 "External Fixation", modify
label def randomlabel 1 "Intramedullary nail", modify