Help using Base SAS procedures

SPATIAL ANALYSIS IN PROC MIXED

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

SPATIAL ANALYSIS IN PROC MIXED

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;

 


Accepted Solutions
Solution
‎03-30-2016 04:38 PM
Respected Advisor
Posts: 4,925

Re: SPATIAL ANALYSIS IN PROC MIXED

[ Edited ]

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.

PG

View solution in original post


All Replies
Super User
Posts: 11,343

Re: SPATIAL ANALYSIS IN PROC MIXED

On

model PG=BLOCO C / DDFM=SATTERTH P;

what is the P requesting?

 

Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

P informs predicted values

Respected Advisor
Posts: 4,925

Re: SPATIAL ANALYSIS IN PROC MIXED

P is a proc reg option. If you want predicted values in proc mixed use OUTP=myDataset

PG
Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

Like this?

model PG=BLOCO C / DDFM=SATTERTH outp=TAB_51;

Super User
Posts: 11,343

Re: SPATIAL ANALYSIS IN PROC MIXED

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;

Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

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?

Solution
‎03-30-2016 04:38 PM
Respected Advisor
Posts: 4,925

Re: SPATIAL ANALYSIS IN PROC MIXED

[ Edited ]

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.

PG
Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

Ok. So how can I request predicted values in another dataset to use in further processing?

Respected Advisor
Posts: 4,925

Re: SPATIAL ANALYSIS IN PROC MIXED

As I said : "Predicted values are given in the dataset named in option outp= in the MODEL statement."

 

outp= Example

PG
Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

Ok. So how can I request predicted values in outp=tab_51P and create a new data set to use in futher processing?

Occasional Contributor
Posts: 7

Re: SPATIAL ANALYSIS IN PROC MIXED

In: proc sort data=EBLUPS; by descending _est_; run; Occurs another error: Variable _EST_ not found. What it can be?
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 706 views
  • 1 like
  • 3 in conversation