Please I have my data in excel and I am using macro statements as shown below. I have my macros to analyze YieldB, YieldC and YieldW (which is working fine). Now I will like to see if there is an interaction between each of these yields and other variables that I have in the excel sheet.
For instance how do I have an interaction statement like YieldB X MeanT and where exactly should it be in the code
My code is below:
proc sort data=C_YieldM;
/* Running Factorial Design without Rep effect but with day effect, The Covtest provides the covariance parameter estimates*/
%macro Rotation (var=);
proc mixed data=C_YieldM;
class Rep Trial T_System;
random Rep(Trial) Trial Trial*T_System/solution;
repeated Trial/subject=rep*T_System type=ar(1) RCORR;
/* Contrasts statement for the management practice */
estimate 'IRR_RF' T_System 1 -1;
ods output diffs=table;
ods output lsmeans=Mylsmeans;
lsd=stderr*tinv(1 -(0.05/2), df);
proc print data=calc_lsd;
*var lsd estimate stderr df;
proc plm restore=Mylsmeans;
lsmeans T_System/pdiff adjust=tukey lines alpha=0.05;
Thanks Tom. I can do the interaction if I used card input, but I have been using macro (with my data in excel) but where to fit in my interaction statement is my concern. Thanks you
That makes no sense to me. A CARDS statement is something you would use in a DATA step. An interaction is something you would specify in some statistical proc. How you read the data makes no difference once you already have the dataset and are running a PROC.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.