Dear all,
I'm doing a scatter plot (potassium levels in 2 distinct moments) with this code (which works fine):
twoway (lfitci Pre_Pot Post_Pot, ciplot(rarea)) (scatter Pre_Pot Post_Pot,c(. l) m(Oh) mc(black) msiz(small)) (line W W, lp(dash) lc(black)) if Sequence==0, ytitle(Potassium(mEq/L)) xtitle(Potassium(mEq/L)) legend(order(1 2)) legend(off) text(7.8 7 "Line 45°",size(vsmall) place(e)) text(5.1 6.8 "Lfit: y=2.10 +0.52x",size(vsmall) place(e)) text(4.9 7 "{&sigma}{superscript:2}=0.43",size(vsmall) place(e)) xlab(2(1)8) ylab(2(1)8) xmtick(##10) ymtick(##10) ysize(5.5) graphregion(fcolor(white))
and produce this graph:
Array
The dashed line (45°) was created just to add a reference to the reader using:
generate W=_n
replace W=. if W>8 | W<1.4
My problem is when I try do to the same graph for the group Sequence=1. Changing the conditional from 0 to 1 the dashed line disappears!
twoway (lfitci Pre_Pot Post_Pot, ciplot(rarea))(scatter Pre_Pot Post_Pot,c(. l) m(Oh) mc(black) msiz(small)) (line W W, lp(dash) lc(black)) if Sequence==1, ytitle(Potassium(mEq/L)) xtitle(Potassium(mEq/L)) legend(order(1 2)) legend(off) text(7.8 7 "Line 45°",size(vsmall) place(e)) text(5.1 6.8 "Lfit: y=2.35 +0.48x",size(vsmall) place(e)) text(4.9 7 "{&sigma}{superscript:2}=0.59",size(vsmall) place(e)) xlab(2(1)8) ylab(2(1)8) xmtick(##10) ymtick(##10) ysize(5.5) graphregion(fcolor(white))
Array
ps: Sequence is a binary variable where 0 the patient started in one dialysis modality (CAPD) whilst 1 the patient started in another dialysis modality (APD)
Regards
Thyago
Related Posts with Line disappears
Effect of schooling on menstruation methodsHello, I am trying to find the effect of schooling on mensuration methods from Indian context.These …
summary forest plot for meta-analysisHello, I am doing a study-level meta-analysis with different outcomes. In addition to the standard …
2:Setting manual coefficientsHi Listers, Y = β1+ β2*Area + β3Labor + β4*Fertilizer + u This time its given that B4=3*B3. Which …
Forecast errorsHi Statlist, I would like to compute the variance of forecast errors in a panel data setting as ind…
Applying Bai-Perron Test to Time Series data structured in panel format Hello, I have a panel dataset where data is there for each country. I want to run the stata command…
Subscribe to:
Post Comments (Atom)
0 Response to Line disappears
Post a Comment