Hi all in Statalist,

I need help with having two reference lines in the same plot.

In our study, we analyzed blood samples (with Sampletype (=Sample) in duplicates (Run 1 and 2) in a reference analyzer (X) and a test analyzer (Y). T3, MoK, LyS etc. are analytes measured in the blood samples by the analyzers. We need to show that the results lie within reference limits. I hereby attach an example of my data:
Code:
Sample   Id   Sampleno    Run     Date    Day    T3_X     T3_Y   MoK_X  MoK_Y   LyS_X   LyS_Y    etc.
----------------------------------------------------------------------------------------------------
                                          
001      X         1       1       23/1     1     89       90.4   31.2   32.1    12      12.3    
001      X         1       2       23/1     1     92.8     91.5   31.9   31.3    13.1    12.5    
002      X         2       1       23/1     1     86.4     83.1   30.4   30.2    12.3    12.5    
002      X         2       2       23/1     1     86.7     84.9   31     30.5    12.2    12.7    
003      X         3       1       23/1     1     84.7     85.4   31.1   31.5    12.1    12.9    
003      X         3       2       23/1     1     85.8     86.1   31.6   31.1    12.8    12.7  
001      Y         1       1       24/1     2     89       90.4   31.2   32.1    12      12.3    
001      Y         1       2       24/1     2     92.8     91.5   31.9   31.3    13.1    12.5    
002      Y         2       1       24/1     2     86.4     83.1   30.4   30.2    12.3    12.5    
002      Y         2       2       24/1     2     86.7     84.9   31     30.5    12.2    12.7    
003      Y         3       1       24/1     2     84.7     85.4   31.1   31.5    12.1    12.9    
003      Y         3       2       24/1     2     85.8     86.1   31.6   31.1    12.8    12.7    
etc.
I plot the T3_X analyte according to the following:
Code:
twoway (scatter T3_X Day if Sample ==001 & Run==1), by(Id) play (Template_Background) ylabel(2(0.1)2.4, angle(h) grid) yline(2.04 2.28)
The "yline" above is for the Id=X. The reference limits for Id=Y are 1.96 & 2.2 "ylabel(1.96 2.2). I wonder how to have the limits for both Id X & Y in the same plot? (For help: suggest that we run Id X from Day 1 to 20 and changed to Id Y from Day 21 to 30)