Hi everyone,

This may have a very simple solution that I'm missing, but I've gotten stuck.

Basically, I want to replicate what I've done with twoway scatter with connected option with twoway line. (I have a good reason for this.) But I'm not getting the same results using the sort option between both. The two sets of code are:

Code:
twoway(scatter efvn timepoint, connect(L) lwidth(medium) lcolor(green%50) sort(study_id) ///
    ytitle(" ") xscale(titlegap(*10)) xtitle("Control Group") xlabel(0.8 " "  1 "Pre-Intervention" 1.5 "Post-Intervention" 1.7 " ", notick labsize(small) angle(0)))


twoway(line efvn timepoint, lwidth(medium) lcolor(green%50) sort(study_id)  ///
    ytitle(" ") xscale(titlegap(*10)) xtitle("Control Group") xlabel(0.8 " "  1 "Pre-Intervention" 1.5 "Post-Intervention" 1.7 " ", notick labsize(small) angle(0)))
And the two plots are below. I cannot figure out why the second plot (the line plot) has extra lines between points, given that the code is the same between the two, except one uses (scatter ... , connected(L)) and the other uses (line ..., ).

Thanks in advance!
John

Array

Array