BookmarkSubscribeRSS Feed
taylor_metz1
Calcite | Level 5

I am trying to conduct a meta-analysis and I have binary variables, so I am attempting to use proc glimmix to accomplish this. When I try, it keeps giving me errors about the variables. 

 

Here is my code and dataset:

 

data meta;
input ID $ shortIPI $ PTB $ Count @@;
datalines;
study1 yes yes 815  study1 yes no 20998
study1 no yes 899  study1 no no 23972
study2 yes yes 6395  study2 yes no 48072
study2 no yes 2338  study2 no no 22276
study3 yes yes 416  study3 yes no 2893
study3 no yes 1291  study3 no no 12434
;
proc print data=meta;
run;
proc freq data=meta;
tables shortIPI*PTB / chisq;
weight count;
run;
proc freq data=meta;
table ID*shortIPI*PTB /cmh;
weight count;
run;
proc means data=meta mean q1 median q3 var stddev;
run;
proc glimmix data=meta;
class ID shortIPI PTB;
model shortIPI/count = count / solution;
random intercept / subject=ID;
run;

 

Here is the error code I keep seeing:

Error: A character response variable is not possible for the chosen distribution. Only for BINARY and
       MULTINOMIAL distributions are character response variables permitted.

 

which I am guessing means I have to merge the binary variable with my count somehow?

1 REPLY 1
PGStats
Opal | Level 21

Looks like you might want:

 

proc sql;
create table counts as
select 
    id, 
    shortIPI, 
    sum(case when PTB="yes" then count else . end) as PTB_yes,
    sum(count) as PTB_all
from meta
group by id, shortIPI;
quit;

proc glimmix data=counts;
class id shortIPI;
model PTB_yes/PTB_all = shortIPI / solution;
random intercept / subject=id;
run;

or maybe exchange the roles of  PTB and shortIPI.

 

PG

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 1411 views
  • 0 likes
  • 2 in conversation