-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the odds ratioes from the RCS analysis? #1
Comments
Hi,
Thanks for your question! I hope I understood you correctly: you would like to get model predicted odds ratios and plot them in a similar way I did with predicted probabilities. My understanding is that either predicted probabilities or marginal effects are actually the recommended way of presenting such results. This is because odds ratios are harder to interpret and they cannot be compared across studies or samples. So my recommendation is actually to use either predicted probabilities or marginal effects.
See, for example:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5867187/
I am not, unfortunately, aware of any methods that would produce predicted odds ratios across different levels of a predictor directly from a regression model. With the predict function, you can obtain either probabilities (type=”response”, ranging from 0 to 1) or log-odds (type=”link”). Hope this helps!
Best wishes,
Kia
From: Liang ***@***.***>
Sent: keskiviikko 30. maaliskuuta 2022 18.26
To: Gluschkoff/tst-depr ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [Gluschkoff/tst-depr] How to get the odds ratioes from the RCS analysis? (Issue #1)
Hi Dr. Kia,
The code in the repository helps me a lot when I am studying the NHANES data analysis. In the plots.R file you plotted the predicted probabilities for specific symptoms using restricted cubic splines analysis, while the y-axis means the probability in the plot.
If I want to describe the relationship between continuous data and a disease outcome (sick or not), how to modify the R code? The ideal plot may like this:
[image]<https://user-images.githubusercontent.com/42333702/160872081-3cfd1a6c-af85-41e0-a9fe-78c61078a120.png>
Should I change the type parameter in this block (line 48)?
# specific symptoms: predicted probabilities and 95% confidence intervals, men
probs1 <- as.data.frame(predict(spl1, newdata=ndatamen, type="response"))
Thanks
—
Reply to this email directly, view it on GitHub<#1>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQEQRJOOPPRT6ETNEDK4VV3VCRXBXANCNFSM5SCKCKVQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Thank you so much for your reply! |
Hi Dr. Kia,
The code in the repository helps me a lot when I am studying the NHANES data analysis. In the

plots.R
file you plotted the predicted probabilities for specific symptoms using restricted cubic splines analysis, while the y-axis means the probability in the plot.If I want to describe the relationship between continuous data and a disease outcome (sick or not), how to modify the R code? The ideal plot may like this:
Should I change the
type
parameter in this block (line 48)?Thanks
The text was updated successfully, but these errors were encountered: