Hello people,
I´m doing a simulation study about spatial analysis with variety trials designed in augmented block. The basic material of this study was an evaluation trial of soybean lines, with five check varieties (of fixed effect) and 110 new genotypes (of random effects).
But I can´t resolve the analysis when in "
model PG=BLOCO C / DDFM=SATTERTH P;
"
I don´t know how to proceed before it. The error appeared:
model PG= BLOCO C / ddfm=SATTERTH P;
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
Please help me!
data TAB_51;
infile 'C:\Dados\TAB_51.prn';
input PARCELA COORDX COORDY BLOCO GENOT$ TIPO$ PG;
C=GENOT; if TIPO='New' then C=0;
if TIPO='New' then NEW=1; else NEW=0;
run;
proc mixed data=TAB_51;
class BLOCO C GENOT;
model PG=BLOCO C / DDFM=SATTERTH P;
random GENOT*NEW / solution cl;
id PARCELA COORDX COORDY BLOCO GENOT TIPO;
contrast 'TESTEMUNHAS' C 0 1 -1 0 0 0,
C 0 0 1 -1 0 0,
C 0 0 0 1 -1 0,
C 0 0 0 0 1 -1;
contrast 'TESTs vs PROGs' C -5 1 1 1 1 1;
contrast 'PROG1 vs PROG2' | GENOT*NEW 1 -1;
contrast 'PROG2 vs PROG3' | GENOT*NEW 0 1 -1;
lsmeans C / cl;
make 'fitting' out=R_IND (rename=(value=VAL_RI));
make 'solutionr' out=EBLUPs;
make 'predicted' out=OBS_PRED;
run;
proc sort data=EBLUPs; by descending _EST_;
proc print; run;
proc autoreg data=OBS_PRED;
model _resid_= / dw=10 dwprob;
run;
proc mixed data=OBS_PRED;
model _resid_= ;
repeated / sub=intercept type=sp (EXP) (COORDX COORDY);
parms (0 to 30 by .5) (100000 to 200000 by 5000);
run;
proc mixed data=TAB_51 noprofile;
class BLOCO C GENOT;
model PG= BLOCO C / ddfm=satterth;
random GENOT*NEW / solution cl;
repeated / sub=intercept type=sp(EXP) (COORDX COORDY);
parms (17242.02) (126450) (6.8) / noiter;
contrast 'TESTEMUNHAS' C 0 1 -1 0 0 0,
C 0 0 1 -1 0 0,
C 0 0 0 1 -1 0,
C 0 0 0 0 1 -1;
contrast 'TESTs vs PROGs' C -5 1 1 1 1 1;
contrast 'PROG1 vs PROG2' | GENOT*NEW 1 -1;
contrast 'PROG2 vs PROG3' | GENOT*NEW 0 1 -1;
lsmeans C / cl;
make 'solutionr' out=EBLUPs;
make 'fitting' out=R_ESP (rename=(value=VAL_RE));
run;
Unless you are using a very old SAS/STAT version, you should replace MAKE statements which are not documented anymore with ODS OUTPUT statements. There is no output table named predicted. Predicted values are given in the dataset named in option outp= in the MODEL statement.
On
model PG=BLOCO C / DDFM=SATTERTH P;
what is the P requesting?
P informs predicted values
P is a proc reg option. If you want predicted values in proc mixed use OUTP=myDataset
Like this?
model PG=BLOCO C / DDFM=SATTERTH outp=TAB_51;
Do not use the name of your input data set if you want to keep it. Your result would create a new tab_51 with the predicitons but lose your original data.
I would suggest outp=tab_51P;
Thanks for everyone! The coments help me to execute part from the analysis. But now another error occurs on
data set WORK.OBS_PRED
proc mixed data=TAB;
32 class BLOCO C GENOT;
33 model PG=BLOCO C / DDFM=SATTERTH outp=tab_51P;
34 random GENOT*NEW / solution cl;
35 id PARCELA COORDX COORDY BLOCO GENOT TIPO;
36 contrast 'TESTEMUNHAS' C 0 1 -1 0 0 0,
37 C 0 0 1 -1 0 0,
38 C 0 0 0 1 -1 0,
39 C 0 0 0 0 1 -1;
40 contrast 'TESTs vs PROGs' C -5 1 1 1 1 1;
41 contrast 'PROG1 vs PROG2' | GENOT*NEW 1 -1;
42 contrast 'PROG2 vs PROG3' | GENOT*NEW 0 1 -1;
43 lsmeans C / cl
44 make 'fitstatistics' out=R_IND (rename=(value=VAL_RI));
45 make 'solutionr' out=EBLUPs;
46 make 'predicted' out=OBS_PRED;
47 run;
NOTE: Convergence criteria met.
NOTE: The data set WORK.TAB_51P has 127 observations and 13 variables.
NOTE: The data set WORK.R_IND has 4 observations and 2 variables.
NOTE: The data set WORK.EBLUPS has 115 observations and 10 variables.
NOTE: The data set WORK.OBS_PRED has 0 observations and 0 variables.
WARNING: Data set WORK.OBS_PRED was not replaced because new file is incomplete.
NOTE: PROCEDURE MIXED used (Total process time):
real time 0.30 seconds
cpu time 0.29 seconds
48 proc sort data=EBLUPs; by descending _est_; run; /*It informs that this internal variable do not exist*\
ERROR: Variable _EST_ not found.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
I think tis problems occurs due ddfm=satterth comand. What do you think?
Unless you are using a very old SAS/STAT version, you should replace MAKE statements which are not documented anymore with ODS OUTPUT statements. There is no output table named predicted. Predicted values are given in the dataset named in option outp= in the MODEL statement.
Ok. So how can I request predicted values in another dataset to use in further processing?
As I said : "Predicted values are given in the dataset named in option outp= in the MODEL statement."
Ok. So how can I request predicted values in outp=tab_51P and create a new data set to use in futher processing?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.