BookmarkSubscribeRSS Feed
paola1
Calcite | Level 5

Hello everybody, I'm using SAS Studio and I'm a beginner, but I have the following problem.

The option CLASS in PROC MIANALYZE after the PROC PHREG doesn't work: where am I doing wrong?

If I run the following code:

 

PROC MI DATA=data NIMPUTE=10 out=out_data seed=54321;
mcmc plots=trace plots=acf ;
VAR hpcr cystatin_c;
RUN;

 

PROC PHREG DATA=out_data;
CLASS sex (REF=FIRST) ipertensione (REF='No') diabete (REF='No')
ipercolesterolemia (REF='No') cvd (REF='No') q_fumo (REF='No') ALBUMINURIA (REF='< 3.4') / PARAM=REF;
MODEL GIORNI*morto_vivo2(0) = ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico colesterolo c_ldl hpcr cystatin_c/ RISKLIMIT COVB;
BY _imputation_;
OUTPUT OUT=mi ParameterEstimates=a_mvn CovB=mxcovb;
RUN;
QUIT;


PROC MIANALYZE PARMS(CLASSVAR=full)=a_mvn COVB(effectvar=rowcol)=mxcovb;
CLASS ALBUMINURIA;
MODELEFFECTS ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico colesterolo c_ldl hpcr cystatin_c;
RUN;

 

The LOG follows:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 PROC MI DATA=INCIPE_SURV NIMPUTE=10 out=OUT_INCIPE seed=54321;
57 mcmc plots=trace plots=acf ;
58 var hpcr cystatin_c;
59 run;
 
NOTE: The EM algorithm (MLE) converges in 4 iterations.
NOTE: The EM algorithm (posterior mode) converges in 2 iterations.
NOTE: The data set WORK.OUT_INCIPE has 37550 observations and 76 variables.
NOTE: PROCEDURE MI used (Total process time):
real time 1.38 seconds
cpu time 0.55 seconds
 
 
60
61 /* 2. Analysis Phase:*/
62 PROC PHREG DATA=OUT_INCIPE;
63 FORMAT ALBUMINURIA albFmt. sex sexFmt. ipertensione ipertensioneFmt. diabete diabeteFmt.
64 q_fumo q_fumoFmt. ipercolesterolemia ipercolesterolemiaFmt. cvd cvdFmt.;
65 CLASS sex (REF=FIRST) ipertensione (REF='No') diabete (REF='No')
66 ipercolesterolemia (REF='No') cvd (REF='No') q_fumo (REF='No') ALBUMINURIA (REF='< 3.4') / PARAM=REF;
67 MODEL GIORNI*morto_vivo2(0) = ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico
67 ! colesterolo c_ldl hpcr cystatin_c/ RISKLIMIT COVB;
68 BY _imputation_;
69 OUTPUT OUT=mi ParameterEstimates=a_mvn CovB=mxcovb;
__________________
22
76
ERROR 22-322: Errore di sintassi, previsto uno dei seguenti: ;, (, /, ATRISK, CIF, DFBETA, LD, LMAX, LOGLOGS, LOGSURV, NUM_LEFT,
OUT, RESDEV, RESMART, RESSCH, RESSCO, STDXBETA, SURVIVAL, WTRESSCH, XBETA.
ERROR 76-322: Errore di sintassi, l'istruzione verrà ignorata.
70 RUN;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PHREG used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
 
71 QUIT;
72
73 /* 3. Pooling Phase: */
74 TITLE 'Multivariate Cox Proportional Hazard Models - Full Model 2';
 
 
75 PROC MIANALYZE PARMS(CLASSVAR=full)=a_mvn COVB(effectvar=rowcol)=mxcovb;
ERROR: File WORK.A_MVN.DATA does not exist.
ERROR: File WORK.MXCOVB.DATA does not exist.
76 CLASS ALBUMINURIA;
77 FORMAT ALBUMINURIA albFmt. sex sexFmt. ipertensione ipertensioneFmt. diabete diabeteFmt.
78 q_fumo q_fumoFmt. ipercolesterolemia ipercolesterolemiaFmt. cvd cvdFmt.;
79 MODELEFFECTS ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico colesterolo c_ldl hpcr
79 ! cystatin_c;
80 RUN;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
81
82 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
94

 

 

So, if I change my code in this way:

 

PROC PHREG DATA=OUT_INCIPE NOPRINT;
CLASS sex (REF=FIRST) ipertensione (REF='No') diabete (REF='No')
ipercolesterolemia (REF='No') cvd (REF='No') q_fumo (REF='No') ALBUMINURIA (REF='< 3.4') / PARAM=REF;
MODEL GIORNI*morto_vivo2(0) = ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico colesterolo c_ldl hpcr cystatin_c/ RISKLIMIT COVB;
BY _imputation_;
OUTPUT OUT=a_mvn;
RUN;
QUIT;


PROC MIANALYZE DATA=a_mvn;
MODELEFFECTS ALBUMINURIA sex age ipertensione diabete ipercolesterolemia q_fumo cvd gfr p_ac_urico colesterolo c_ldl hpcr cystatin_c;
RUN;

 

I receive this message in the LOG file right after the PROC MIANALYZE:

 

ERROR: The input TYPE= data set is not a valid data set without specifying variables for standard errors in the STDERR statement.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

 

1 REPLY 1
rayIII
SAS Employee

Hi, Paola.

 

You're trying to pass a table of parameter estimates to proc mianalyze. 

 

You can get the parameter estimates from PHREG as ODS output. Try changing your OUTPUT statement as follows: 

 

  ods output parameterEstimates  = a_mvn; 

Ray

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2823 views
  • 0 likes
  • 2 in conversation