Hi, @StatDave I'd like to calculate prevalence ratios in SAS with a binary outcome having many covariates. Data look like this roughly: data have;
input m$ a$ b$ c @@;
datalines;
0 1 0 34 1 2 0 56
1 3 1 54 0 2 1 23
; m is a binary outcome (0 or 1), a (1, 2, or 3) and b (0 or 1) is categorical exposures, and c is continuous one. In fact, I have more than 10 variables to be included in the dataset. Some of them are continuous and others are ordinal or binary. At first, I calculated odds ratios very easily as follows: proc logistic data=have descending;
class a (ref="1") b (ref="1") / param=glm;
model m(event="1") = a b c;
lsmeans a b c/ e ilink;
ods output coef=coeffs;
store out=ques;
run; So I tried calculate prevalence ratios with a macro: %nlmeans(instore=ques, coef=coeffs, link=logit, options=ratio, title=Relative Risk) But there was a warning message: The final Hessian matrix is not positive definite, and therefore the estimated covariance matrix is not full rank and may be unreliable. The variance of some parameter estimates is zero or some parameters are linearly related to other parameters. I also tried it using PROC GENMOD proc genmod data=have descending;
class a (ref="1") b (ref="1") ;
model m = a b c / dist=bin link=log type3 corrb;
estimate "RR for a1" a 1 -1 0 /exp;
estimate "RR for a2" a 1 0 -1 /exp;
estimate "RR for b"b 1 -1 /exp;
estimate "RR for c" c 1 /exp;
run; And I also got a warning message like this: The relative Hessian convergence criterion of 0.0199906038 is greater than the limit of 0.0001. The
convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable. In addition, the direction of estimates is totally different from the results out of PROC LOGISTIC. For example, while I got the estimate 0.55 and 0.32 for each group of variable "a" from logistic regression, PROC GENMOD showed 1.44 and 3.56, respectively. I want to estimate for all variables that I include. So I tried dist=poisson instead of bin, but I am not sure if this is correct. I have reviewed this note (https://support.sas.com/kb/23/003.html) but I guess this was calculated from count data. Mine has a binary outcome. I've also heard that I could try calculate adjusted prevalence or marginal prevalence. But I have no idea how to calculate this in SAS. Please help me out to estimate prevalence ratios correctly in this situation. Thanks!
... View more