Skip to main content

Posts

Showing posts from September, 2018

Reporting results from transformed analyses

Objective :  Transformed data, for example log(y), is analyzed to correct normality or equal variance requirements.  But we want to report means and standard errors in the original units. SAS example : data one;  do treat=1 to 3;  do rep=1 to 5;    y=10 + treat+ exp(rannor(111));    logy=log(y);    output;  end;end; run; proc mixed plots=all;   class treat;   model y=treat;   lsmeans treat/pdiff; run; proc mixed plots=all;   class treat;   model logy=treat;   lsmeans treat/pdiff; run; The original data, variable y, might have units of pounds.  If a transformation is needed, we simply calculate a new variable by applying a mathematical function known to improve normality or equal variance, and run the same analysis on the new variable.  Commonly used choices are listed in the second table below. However, looking at the results for both analyses we see treat Mean Y SE Y Mean logY SE logY BT Mean BT SE 1 12.55 0.771 2.52 0.054   12.43    0.67 The

Getting higher quality default graphs in SAS

Objective : I am running a statistical analysis in SAS, and the default ODS graphics look good, but I need them to be publication quality. SAS can automatically create some nice graphs, and has greatly increased the availability of graphs within procedures.  If you like what you see, you might copy graphs directly from the SAS output window, or possibly you save graphs and output to a pdf or other external file format.  But this output will be low quality, generally 75 dpi.  Instead, add the following statements to write graphics directly to files, allowing control of format and quality. ods graphics on /       width=7in       imagefmt=tiff       imagemap=off       imagename="MyPlot"       border=off; ods listing file="Body.rtf" style=journal gpath="."  dpi=600; Once these statements have been submitted, all graphs created by subsequent procedures will be written  to files named MyPlotxx.tiff, where xx will be sequential numbers.  The tiff opt