Cross Validated
2022-08-05 07:46 UTC
By josh
AI-113-20220805-social-media-f1153c6e
How can I calculate the odds of exposure for >1 outcome group, combined, using the rms::lrm function. Predict? Contrast?
I have been using a logistic model from rms::lrm to estimate the odds ratio of a binary exposure on an outcome, using splines [time] as Frank Harrell recommended. I am using Predict and Contrast to estimate time-varying coefficients which can be further manipulated. An example using the inbuilt ToothGrowth dataset: #Install and load packages library("rms") library("dplyr") #develop a binary predictor variable with values A and B data(ToothGrowth) ToothGrowth % mutate(dose_binary = case_when( dose >1 ~ "A", TRUE ~ "B")). #run logistic regression with 5 restricted cubic splines dd This works very well, but I would like to estimate the odds (not odds ratio) of exposure in both outcome groups , combined (e.g., the average of p1 and p2); along the time-varying spline function (and I have additional covariates in the final model too). The underlying problem is to estimate the association between therapy A vs therapy B on the probability of a severe outcome: OR (severe) = odds(severe)/odds(control) But I lack data on controls. I wish to estimate the odds in controls, borrowing probabilities I DO have from different but related sources (bold indicates data I have access to): A) OR(s/m) = odds(severe)/odds(mild) and B) OR(severe+mild) = odds(severe + mild)/odds(control) My logic was to calculate the joint probabilities in both the “severe” and “mild” groups (from A) and estimate the odds in the control group that I lack by: Odds(control) = odds(severe + mild, from A)/OR(severe + mild…
I have been using a logistic model from rms::lrm to estimate the odds ratio of a binary exposure on an outcome, using splines [time] as Frank Harrell recommended. I am using Predict and Contrast to estimate time-varying coefficients which can be further manipulated. An example using the inbuilt ToothGrowth dataset: #Install and load packages library("rms") library("dplyr") #develop a binary predictor variable with values A and B data(ToothGrowth) ToothGrowth % mutate(dose_binary = case_when( dose >1 ~ "A", TRUE ~ "B")). #run logistic regression with 5 restricted cubic splines dd This works very well, but I would like to estimate the odds (not odds ratio) of exposure in both outcome groups , combined (e.g., the average of p1 and p2); along the time-varying spline function (and I have additional covariates in the final model too). The underlying problem is to estimate the association between therapy A vs therapy B on the probability of a severe outcome: OR (severe) = odds(severe)/odds(control) But I lack data on controls. I wish to estimate the odds in controls, borrowing probabilities I DO have from different but related sources (bold indicates data I have access to): A) OR(s/m) = odds(severe)/odds(mild) and B) OR(severe+mild) = odds(severe + mild)/odds(control) My logic was to calculate the joint probabilities in both the “severe” and “mild” groups (from A) and estimate the odds in the control group that I lack by: Odds(control) = odds(severe + mild, from A)/OR(severe + mild…
Full article content could not be extracted automatically. Read the original below.
Source:
Cross Validated
· stats.stackexchange.com