Prev: Surprised that the case statement in proc sql does not support lists
Next: help with counting occurences of a string
From: Shaik Hymad on 8 Feb 2010 01:39 HI To all, I have a data like I have variables like 'geomean' id Gemotric mean time point varaible and trt varaible having 1 and 2 values. TIMEPT TRT ESTIMATE STDERR PVAL LOWER UPPER GEOMEAN tpt 1.1 1 -0.2978 0.1266 0.0245 -0.5549 -0.0407 0.5037 0.9 1.1 2 -0.2148 0.1232 0.0903 -0.4652 0.0356 0.6098 0.91 1.2 1 -0.3174 0.1283 0.0196 -0.5800 -0.0548 0.4815 1.1 1.2 2 -0.1942 0.1259 0.1344 -0.4522 0.0639 0.6395 1.11 3.1 1 -0.2231 0.1091 0.0498 -0.4460 -0.0002 0.5983 2.9 3.1 2 -0.2781 0.1065 0.0142 -0.4960 -0.0602 0.5271 2.91 3.2 1 -0.1790 0.1042 0.0968 -0.3925 0.0344 0.6622 3.1 3.2 2 -0.2886 0.1021 0.0088 -0.4982 -0.0790 0.5145 3.11 5.1 1 -0.0591 0.0957 0.5414 -0.2537 0.1356 0.8728 4.7 5.1 2 0.0337 0.0932 0.7201 -0.1560 0.2233 1.0807 4.71 5.2 1 -0.2027 0.0972 0.0456 -0.4012 -0.0043 0.6270 4.9 5.2 2 -0.0958 0.0926 0.3095 -0.2853 0.0937 0.8020 4.91 5.3 1 -0.0819 0.1143 0.4811 -0.3184 0.1546 0.8282 5.1 5.3 2 -0.1322 0.1115 0.2487 -0.3636 0.0992 0.7376 5.11 I want to create a plot figure with Standard error bars using Gemetric mean values. to get standard error bars, i used annotate options can you please check the following coding and let me know,where im wrong? data final; set st_1; if trt eq 1 then do; if timept=1.1 then tpt=.9; else if timept=1.2 then tpt=1.1; else if timept=3.1 then tpt=2.9; else if timept=3.2 then tpt=3.1; else if timept=5.1 then tpt=4.7; else if timept=5.2 then tpt=4.9; else if timept=5.3 then tpt=5.1; end; if trt eq 2 then do; if timept=1.1 then tpt=.91; else if timept=1.2 then tpt=1.11; else if timept=3.1 then tpt=2.91; else if timept=3.2 then tpt=3.11; else if timept=5.1 then tpt=4.71; else if timept=5.2 then tpt=4.91; else if timept=5.3 then tpt=5.11; end; run; data annot1(keep=lb ub trt); set final; lb=10**(estimate-stderr); ub=10**(estimate+stderr); run; data anno; length color function $8; retain xsys ysys '2' hsys '4' when 'a' color 'red' size 1; set annot1; group=_name_; ** to assign to the right group value **; function='move'; xsys='2'; ysys='2'; midpoint=trt; y=lb; output; function='draw'; xsys='7'; ysys='2'; x=-2; y=lb; output; function='draw'; xsys='7'; ysys='2'; x=+4; y=lb; output; function='move'; xsys='2'; ysys='2'; midpoint=trt; y=ub; output; function='draw'; xsys='7'; ysys='2'; x=-2; y=ub; output; function='draw'; xsys='7'; ysys='2'; x=+4; y=ub; output;*/ * To Join upper and lower bounds*; function='move'; xsys='2'; ysys='2'; midpoint=trt; y=lb; output; function='draw'; xsys='2'; ysys='2'; midpoint=trt; y=ub; output; run; ******************* ** Output Figure ** *******************; symbol1 i=line font=orfont v='C' line=2 width=1 color=purple mode=include height=0.8; symbol2 i=j font=orfont v='E' c=red height=0.8; /* symbol1 value='D' i=line line=2 width=1 color=blue mode=include;*/ /* symbol2 value='L' i=line line=1 width=1 color=red mode=include; */ proc gplot data=final; plot geomean*tpt=trt / nolegend haxis=axis2 vaxis=axis1 noframe; run; quit; |