BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vincenty43
Calcite | Level 5

Dear all,

 

Recently i run the two parts of code below. one is from mine and one is from QCer. we have dataset inputed exactly the same except the study name(see below). and when we use proc mixed to run the meta analysis, we used the same code, however, the results generated from proc mixed are different.  

 

In the proc mixed, the class statement will consider the study name as categorical, but why length of this variable is impacting the output, anyone has any idea? Thanks a lot!

 

PS: I am using SAS 9.4, but i think this may not be the version issue since I run both code on one laptop.

--------------------------------------------------------------------------------------------

part 1

%let z_alpha=quantile('NORMAL',0.975);

 

data tmp;

     format study $3.;

     input study $ HR CI_lower CI_upper;

     cards;

     Brayden 1.6 1.23 2.02

     Mary 3.50 2.97 4.32

     Olive 2.36 2.04 2.80

     Panda 1.48 1.10 1.98

     ;

run;

 

data table5;

     set tmp;

     est = log(HR);

     se = (log(CI_upper) - log(CI_lower))/2/&z_alpha.;

     v=se*se;

run;

 

data tmp;

     format study $10.;

     study = "intercpt";

     v = 0.001;

run;

data var;

     set tmp table5(keep=study v);

     rename v = est;

run;

 

ods output SolutionF=out1;

proc mixed data=table5 method=reml;

     class study;

     model est = / cl solution ;

     random study / solution;

     repeated / group = study;

     parms / parmsdata=var eqcons=2 to 5;

run;

 

data out2;

     set out1;

     HR = round(exp(Estimate),0.01);

     CI_lower = round(exp(Estimate - StdErr*&z_alpha.),0.01);

     CI_upper = round(exp(Estimate + StdErr*&z_alpha.),0.01);

     se_logHR = round((log(CI_upper) - log(CI_lower))/2/&z_alpha, 0.001);

     *keep HR CI_lower CI_upper se_logHR;

run;

 

--------------------------------------------------------------------------------------------

part 2

 

data all; 

     length study $32;

    

     study = "Brayden C";

     hr  =1.6;

     lcl =1.23;

     ucl =2.02;

     output;

    

     study = "Mary C";

     hr  =3.50;

     lcl =2.97;

     ucl =4.32;

     output;

    

     study = "S_Olive C";

     hr  =2.36;

     lcl =2.04;

     ucl =2.80;

     output;

    

     study ="Panda Cancer";

     hr  =1.48;

     lcl =1.10;

     ucl =1.98;

     output;

run;

 

data _all;

     set all;

     est = log(HR);

     se  = (log(ucl)-log(lcl))/2/quantile('NORMAL',0.975);

     v=se*se;

run;

    

proc print;

     title "Estimates in Different Population";

     run;

 

data intercept;

     length study $64;

     study = "intercept";

     v = 0.001;

run;

    

data var_all;

     set intercept _all(keep=study v);

     rename v = est;

run;

ods listing close;

 

ods output SolutionF=out_all;

proc mixed data=_all method=reml;

     class study;

     model est = / cl solution ;

     random study / solution;

     repeated / group = study;

     parms / parmsdata=var_all eqcons=2 to 5;

run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@vincenty43 wrote:

Thanks Reeza. - Could you please clarify a little bit, The only difference is the categorical variable name, others are exact the same. how would this make design matrix different?

 


Because of how the reference variables are set. 

If the categories change, the reference values may differ. 

 

 

View solution in original post

5 REPLIES 5
Reeza
Super User

Compare the design matrix between the two models.

vincenty43
Calcite | Level 5

Thanks Reeza. - Could you please clarify a little bit, The only difference is the categorical variable name, others are exact the same. how would this make design matrix different?

 

Reeza
Super User

@vincenty43 wrote:

Thanks Reeza. - Could you please clarify a little bit, The only difference is the categorical variable name, others are exact the same. how would this make design matrix different?

 


Because of how the reference variables are set. 

If the categories change, the reference values may differ. 

 

 

SteffenF
Fluorite | Level 6

The within-study variance in the prostate cancer study equals 0.022485. However, in Part 2, you have - unintentionally - fixed this value at 0.019584 (which is the within-study variance of the solid tumors study). Hence, the result of part 2 is wrong. The reason is that in the dataset with the variance components, the studies were not ordered alphabetically (Breast Cancer - Multiple Myeloma -Solid Tumors- Prostate Cancer). This conflicts when assigningthe parameter values to the ordered studies  (in the PARMS statement).

 

In part 1, you don't have this problem since studies were ordered alphabetically (BC - MM - OST - PC). To avoid this type of problems, I never use study names to identify the studies, but study numbers.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1817 views
  • 6 likes
  • 3 in conversation