[R] Converting SAS Code

Andrew Harmon andrewharmon42 at gmail.com
Fri Sep 29 14:47:37 CEST 2017

Hello all,

My statistical analysis training up until this point has been entirely done
in SAS. The code I frequently used was:

*Yield Champagin;

data yield;

set stress;

if field='YV' then delete;

if field='HB' then delete;

if barcode='16187DD4015' then delete;

if barcode='16187DD6002' then delete;

if barcode='16187DD2007' then delete;

if barcode='16187DD5016' then delete;

if barcode='16187DD8007' then delete;

if barcode='16187DD7010' then delete;

if barcode='16187DD7007' then delete;

if barcode='16187DD8005' then delete;

if barcode='16187DD6004' then delete;

if barcode='16187DD5008' then delete;

if barcode='16187DD7012' then delete;

if barcode='16187DD6010' then delete;

run; quit;

Title'2016 Asilomar Stress Relief champagin yield';

proc mixed method=reml data=yield;

class rep Management Foliar_Fungicide Chemical_Treatment;

model Grain_Yield__Mg_h_ =Management|Foliar_Fungicide|Chemical_Treatment
Final_Stand__Plants_A_ / outpred=resids residual ddfm=kr;

random rep rep*Management rep*Management*Foliar_Fungicide;

lsmeans Management|Foliar_Fungicide|Chemical_Treatment / pdiff;

ods output diffs=ppp lsmeans=means;

ods listing exclude diffs lsmeans;

run; quit;



ods graphics off;

run; quit;

proc univariate data=resids normal plot; id Barcode Grain_Yield__Mg_h_
pearsonresid; var resid;
proc print data=resids (obs=3);run;

Can someone please help me convert my code to R? Any help would be much


Andrew Harmon

	[[alternative HTML version deleted]]

More information about the R-help mailing list