Hi,
Below is the code that I used for exporting the OR (95%CI) from the univariate logistic regression model. I would like to change the code to Glimmix model this time and output the p-values along with the OR (95%CI), but I am not sure how to change the code below:
/*Categorical Variable*/ %macro IP(x=,order=); ods select cloddswald; ods output cloddswald=odds_&order.;
proc logistic data = CP_new; class &x.; model improve = &x. /rl; run; %mend IP;
%IP(x=Age_C, order=01); %IP(x=Gender, order=02); %IP(x=Comorbid_CV, order=03); %IP(x=Comorbid_Pulm, order=04);
data toprint; length effect $ 40; set odds_01 - odds_4; order = _n_; comparison = "(" || strip(substr(effect, anyspace(effect))) || ")"; name = scan(effect, 1); run;
proc contents data = cp2 out = temp; run;
proc sort data = temp; by name; run;
proc sort data = toprint; by name; run;
data toprint; merge toprint(in = in1) temp;
by name;
if in1;
vout = catx(" ", strip(coalescec(label, name)), comparison);
orout = strip(put(OddsRatioEst, 12.2)) || " (" ||
strip(put(LowerCL, 12.2)) || ", " ||
strip(put(UpperCL, 12.2)) || ")";
label vout = "Variable"
orout = "Odds Ratio"; run;
proc print data = toprint noobs label; var vout orout; run;
data print; set toprint; keep vout orout; run;
proc export data=print dbms=xlsx outfile="H:\Project\SAS Program\OR_Categorical_12-18-2020.xlsx" replace; run;
Currently, I am trying to modify the macro to Glimmix as below:
/*Categorical Variable*/
%macro IP(x=,order=); ods select cloddswald; ods output cloddswald=odds_&order.;
proc glimmix data = All plots =(all) noclprint method=quad; class ID &x; model robot_diagnostic (event=' Yes') = &x / solution dist=binary oddsratio ; random intercept /subject = ID; run;
%mend IP;
%IP(x=Age_C, order=01);
... View more