12 articles on R language will give you an in-depth understanding of Restricted cubic spline (RCS)

Clinically, the relationship between the dependent variable and the clinical outcome is sometimes not linear, and an important assumption of the regression model is that the independent variable and the dependent variable are linearly related. Therefore, the use of regression analysis to fit the nonlinear relationship model is limited. Therefore, a better solution is to fit the nonlinear relationship between the independent variable and the dependent variable. Restricted cubic spline (RCS) is one of the most common methods to analyze nonlinear relationships.

This public account has written many articles one after another to take you to understand the Restricted Cubic Spline (RCS) from the simple to the in-depth.

Setup RCS via Spline Regression node

R language spline regression and draw restricted cubic bar plot

Insert image description here
2. The RMS package draws restricted cubic splines. This is the most commonly used method at present, and most people use this method.

Example demonstrating how to create a restricted cubic bar chart using R language

Insert image description here
3. Restricted cubic splines based on logistic regression and linear regression of the RMS package, which is an extension of the previous article.

R language to draw restricted cubic bar chart 2 (based on logistic regression and linear regression)

Insert image description here
4. Draw two or more restricted cubic splines

Two methods in R language to draw classified RCS curves

Insert image description here
5.ggplot draws histogram + restricted cubic spline + dual axis chart

R language ggplot draws histogram + restricted cubic spline + dual axis chart

Insert image description here
6. Draw a restricted cubic bar chart of complex sampling design data (NHANES data). Although there are many methods on the market, looking back, my method is more reliable.

R language to draw complex sampling design logistic regression restricted cubic spline (RCS)

Insert image description here
7. From the fun function of the RMS package, we can see how to manually derive HR or OR values ​​from complex sampling models and draw restricted cubic spline functions. Although it is not difficult to do, the derivation also takes a lot of time.

See how to manually derive HR or OR values ​​from complex sampling models and draw restricted cubic spline functions from the fun function of the RMS package (attached is a function I wrote myself to generate results with one click)

Insert image description here
8. At the request of fans, I wrote a linear cubic spline diagram for nhanes database interpolation.

nhanes database mining tutorial 5-merge effect values ​​on imputed data and draw multiple linear regression restricted cubic splines

Insert image description here
9. Calculation of P for overall and P for nonlinear in restricted cubic splines (RCS)

Calculation of P for overall and P for nonlinear in restricted cubic spline (RCS)

Insert image description here
10. Many people are interested in limiting cubic spline turning points, and released the threshold function to generate data tables with one click.

cox regression RCS threshold function cut.tab1.3 released

Insert image description here
11. At the request of fans, make minor adjustments to the restricted cubic spline function and draw multiple legends manually.

Add different legends for RCS curves

Insert image description here
12. Wrote the ggrcs package, which is currently version 2.9, and can easily draw rcs curves.

Version 2.4 of the ggrcs package is online: an R package for drawing histograms + restricted cubic splines + dual axis plots

Version 2.9 of the ggrcs package is released----added the singlecs function for drawing individual rcs curves (restricted cubic splines)

Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/dege857/article/details/133607740