BookmarkSubscribeRSS Feed
PamG
Quartz | Level 8

I have to build seperate models for each of the 9 regions and then pool the parameter coefficients .  I am using PROC MIXED to meta analyze the independent results.  I am following the following Gaspirini paper and trying to build it in SAS.  The SAS data is also available on the following site.

https://github.com/gasparrini/2012_gasparrini_StatMed_Rcodedata/blob/master/regEngWales.csv

 

I keep getting an error at the PARM statement.  I think I am not able to pass the covariance matrix which is fixed.

 


PROC IMPORT DATAFILE="myfolder\regEngWales.csv" 
OUT=meta DBMS=csv REPLACE;
RUN;

%MACRO coeff(reg,regionn);
PROC GLIMMIX DATA=meta;* ASYCOV; * displays asymptotic covariance;
CLASS dow(REF="Fri");*/REF=REFERENCE;
MODEL death=tmean dow / DIST=POISSON COVB DDFM = RESIDUAL SOLUTION; **displays approximate covariance;
RANDOM _RESIDUAL_;
WHERE region=&reg.;;
ODS OUTPUT ParameterEstimates=coeffs&reg. /*covp*/ covparms=vcov&reg.;
run;

DATA coeffs&reg.;SET coeffs&reg.; regnames="&regionn."; n=_N_;RUN;
DATA vcov&reg.;SET vcov&reg.; regnames="&regionn."; n=_N_; RUN;
%MEND;
%coeff(1,%STR(N-East)); %coeff(2,%STR(N-West)); %coeff(3,%STR(York&Hum)); %coeff(4,%STR(E-Mid)); 
%coeff(5,%STR(W-Mid)); %coeff(6,%STR(East)); %coeff(7,%STR(London)); %coeff(8,%STR(S-East));
%coeff(9,%STR(S-West)); %coeff(10,%STR(Wales));
   
***process coeff data;
DATA coeff; FORMAT regnames $10.; SET coeffs1-coeffs10; 
	IF effect IN ("Residual") OR dow IN ("Fri") THEN DELETE;
	KEEP effect dow estimate regnames n; 
RUN;

***process covariance data;
DATA vcov; FORMAT regnames $10.; SET vcov1-vcov10; 
	IF dow IN ("Fri") THEN DELETE;
	*KEEP effect dow estimate regnames n; 
	RENAME col1=covp1 col2=covp2 col3=covp3 col4=covp4 col5=covp5 col6=covp6 col7=covp7 col8=covp8;
	DROP effect dow col9 n regnames;

RUN;


PROC MIXED DATA=coeff COVTEST METHOD=ML; 
CLASS regnames; 
MODEL estimate=/SOLUTION DDFM=BW; *P; 	* empty model for effect size;
RANDOM regnames/SOLUTION;  				* allowing heterogeneity in d;
REPEATED/GROUP=regnames TYPE=VC; 		* separate residual variance per study;
PARMS / PARMSDATA=vcov hold=1 to 8;  * hold residual variances at known values;; 
RUN;

 

 

4 REPLIES 4
ballardw
Super User

 

Please show the LOG with the code and all of the notes and messages from that step as well as the complete text of the error message. Please copy the text and paste into a text box opened on the forum with the </>.

 

 

PamG
Quartz | Level 8

The error message is given below.

 

46         
47         
48         PROC MIXED DATA=coeff COVTEST METHOD=ML;
49         CLASS regnames;
50         MODEL estimate=/SOLUTION DDFM=BW; *P; 	* empty model for effect size;
51         RANDOM regnames/SOLUTION;  				* allowing heterogeneity in d;
52         REPEATED/GROUP=regnames TYPE=VC; 		* separate residual variance per study;
53         PARMS / PARMSDATA=vcov hold=1 to 8;  * hold residual variances at known values;;
54         RUN;

ERROR: The PDATA= data set must contain the numeric variables Estimate or CovP1-CovP11.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The PROCEDURE MIXED printed page 1.
NOTE: PROCEDURE MIXED used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds
      
ballardw
Super User

When  you look at the data step that creates Vcov data set you only rename 8 variables to the expected names.

Since the procedure expects 11 variables named Covp1 to Covp11 there are apparently at few things to do: create the data set VCov11; include vcov11 on the Set statement, Rename enough variables to have CovP9, Covp10 and Covp11 as numeric variables. Or determine what in your model is expecting 11 levels and reduce that.

DATA vcov; FORMAT regnames $10.; SET vcov1-vcov10; 
	IF dow IN ("Fri") THEN DELETE;
	*KEEP effect dow estimate regnames n; 
	RENAME col1=covp1 col2=covp2 col3=covp3 col4=covp4 col5=covp5 col6=covp6 col7=covp7 col8=covp8;
	DROP effect dow col9 n regnames;

RUN;

Caveat: I don't use Proc Mixed but my feeling is that something has 11 levels and the procedures want to see them available even if you only intend to use , i.e. Hold 8 of them,

PamG
Quartz | Level 8

My covariance matrix is an 8x8 matrix (Intercept+ tmean+6 days of week excluding the reference level) for each region.  I need to provide covariance matrix for each region in PROC MIXED.   I am not sure what the other rows/columns will be.

 

I am tagging @Rick_SAS .Thanks.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

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.

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
  • 4 replies
  • 397 views
  • 0 likes
  • 2 in conversation