Skip to content
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

Open
zhaoliang0302 opened this issue Mar 30, 2022 · 2 comments
Open

How to get the odds ratioes from the RCS analysis? #1

zhaoliang0302 opened this issue Mar 30, 2022 · 2 comments

Comments

@zhaoliang0302
Copy link

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

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

@Gluschkoff
Copy link
Owner

Gluschkoff commented Mar 30, 2022 via email

@zhaoliang0302
Copy link
Author

zhaoliang0302 commented Mar 31, 2022

Thank you so much for your reply!
I searched a lot and found that rms package can do RCS analysis and produce the OR values for the next visualization (just like my ideal plot). However, the Predict funtion in the rms package only supports the regression model built with lrm and ols function, which means svyglm function is not allowed. Considering the survey weight is ignorable in the NHANES data analysis, I will follow your procedures in my next study.
Thank you for your advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants