- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, can anyone tell me the SAS code that I would need to make a table like this? I assume that proc logistic was used. I don't need the proc report part as I know how to do that but an example of getting the odds ratios out of proc logistic would be helpful with the stratification variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
With stratification variable, I guess you mean CLASS effect.
The Odds Ratios are available in standard output of PROC LOGISTIC, so you just capture the output object in a data set using ODS OUTPUT, like here:
ods trace off;
ods output OddsRatios = work.OddsRatios;
proc logistic data=sashelp.class;
class age;
id name;
model sex = age weight height;
run;
/* end of program */
Note PROC LOGISTIC has an
"ODDSRATIO Statement"
which produces odds ratios for variable
even when the variable is involved in interactions with other covariates, and for classification variables that use any parameterization. You can also build Customized Odds Ratios.
Kind regards,
Koen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
By stratification, I meant like Any UI and UUI in the picture. There would likely be a variable in the dataset that would stratify the columns for the report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I guess its not clear what you mean. Show us a small portion of a data set to illustrate what you mean by "stratify the columns". (Or do you really mean "stratify the observations", such as separate odds ratios for males and females in the example by @sbxkoenk?)
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you see how it is split into Any UUI and UUI only? I am asking how to create the table in the picture. The dataset from what @sbxkoenk posted only has effect, oddsratioest, and lowerCL and upperCL. I need multiple columns of odds ratios like the picture, not just one column. How do you get that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are "Any UUI" and "UUI Only" separate columns in the data set, or are they different values of one variable? Again, this all becomes clear if you show us a small portion of the data set.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @PaigeMiller . I've never made a table like this before. That's why I'm asking here because I want to learn how. Can you please tell me how this could be achieved assuming that it's values of the same variable? Just assume stratvar=1 means Any UUI and stratvar=2 means UUI only. Would I have to do proc logistic twice with where stratvar=1 and a second time with stratvar=2 or can it be done all one proc logistic?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The code from @sbxkoenk shows exactly how to get these odds ratios. If you have two values of STRATVAR, you could use BY STRATVAR; in your PROC LOGISTIC.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @tarheel13,
Googling a bit, I assume that "UI" and "UUI" stand for "(urge) urinary incontinence." So, these should be the dependent (dichotomous) variables in the logistic regression(s) and column "Parameter" of the table contains demographic characteristics and pre-existing health conditions whose impact on the probability of developing UI or UUI is to be examined (i.e., predictors on the right hand side of the model equation) -- with one exception: the "Model C index" in the last row sounds more like the c statistic (=area under the ROC curve) shown in section "Association of Predicted Probabilities and Observed Responses" at the bottom of the PROC LOGISTIC output. Without this row in the table I would have thought that each predictor -- Age (continuous; in years?), Race/Ethnicity (categorical with five categories), ..., Prostate cancer (dichotomous, yes vs. no) -- would be used in a univariable logistic regression, actually two logistic regressions: one with UI (yes/no) and one with UUI (yes/no) as the dependent variable. Each of these would yield an odds ratio (or k-1 odds ratios in the case of categorical predictors with k categories). But the single c statistic suggests that (also?) multivariable logistic regressions were performed. With all of the above factors in the models? Or only those whose odds ratios were printed in bold face? Or some other subset? We can't tell from the table. Either way, these multivariable logistic regressions would likewise produce odds ratios for each of the predictors in the model, in this case adjusted for the remaining predictors in the model.
The first step in preparing such a table would be to create an analysis dataset for PROC LOGISTIC with the variables needed, in particular the dichotomous variables representing UI and UUI, respectively, if they don't already exist. Technically, this could also be a single variable, coded like 0=no UI, 1=any UI [edit:] except UUI, and 2=UUI, requiring more effort to tell PROC LOGISTIC what the target category is, but personally I would prefer two separate 0-1 variables. Some of the predictor variables might need some preparation as well (e.g., categorization of BMI into "obese", "overweight" and "normal weight").
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@FreelanceReinh I took it from a paper.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@tarheel13 wrote:
The dependent variables were the UIsubgroups (e.g., no incontinence vs. UUI) and an overall logisticregression with ‘‘any incontinence’’ as the dependent variable(yes to any of the UI symptoms in Table I).
This makes sense. So, the first model excluded the subgroup "non-urge" UI in order to focus on UUI cases. And the models seem to include almost all predictors listed in the table, suggesting that the odds ratios were taken from the multivariable analyses.