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?
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.