Movatterモバイル変換


[0]ホーム

URL:


CRAN_Status_BadgeCRAN_downloads_monthCRAN_downloads_total

rmsMD

rmsMD provides streamlined functions for summarisingand visualising regression models fitted with thermspackage, in the preferred format for medical journal reporting.

It includes support for linear, logistic, and Cox models, handlesrestricted cubic splines (RCS) automatically, and producespublication-ready tables and plots.

To learn more about the concepts underlying non-linear regressionmodelling and restricted cubic splines, see our related publication,Non-linear regressionmodelling for medical professionals: making curved pathsstraightforward.


Installation

You can installrmsMD from CRAN:

install.packages("rmsMD")

It is recommended that this package is used alongsiderms, which can be installed via:

install.packages("rms")

Quick start

Fit regressionmodels and create clean outputs

Fit a logistic regression model with restricted cubic splines for ageand BMI.
Generate a publication-ready summary table from the fitted model.

library(rmsMD)library(rms)# Fit an OLS model including a restricted cubic spline# for Age and BMI (with 4 knots)fit_lrm<-lrm(majorcomplication~rcs(age,4)+rcs(bmi,4)+                 sex+                 smoking,data = data)# Generate a publication-ready summary tablemodelsummary_rms(fit_lrm)

Example output table


Building basic plots

Create basic plots of the model’s restricted cubic spline terms tovisualize adjusted effects.

# Most basic outputggrmsMD(fit_lrm, data)

Basic RCS plot


Plot customisation

Customize axis labels, plot titles, and shading to highlight inferioroutcomes visually.

# x axis labels can be stored in a listxlabels<-list ("age"="Age (years)","bmi"="Body Mass Index")# titles for each variable can be stored in a listtitles<-list ("age"="Impact of Age on Complications","bmi"="Impact of BMI on Complications")ggrmsMD(fit_lrm, data,# set y axis label for all plotsylab ="Complications (adjusted OR)",# set y axis limitsylim =c(0,3),# set higher OR as inferior outcome to assign red shadingshade_inferior ="higher",# set x axis labels for each variablexlabs = xlabels,# set titles for each variabletitles = titles        )

Advanced RCS plot


Citation

If you usermsMD in your work, please cite thefollowing article:

Tingle SJ, Kourounis G, Elliot S, Harrison EM. Non-linear regressionmodelling for medical professionals: making curved pathsstraightforward.Postgrad Med J. 2025 Nov; qgaf183. DOI:10.1093/postmj/qgaf183

BibTeX entry for reference managers:

@article{10.1093/postmj/qgaf183,author = {Tingle, Samuel J and Kourounis, Georgios and Elliot, Sarah and Harrison, Ewen M},title = {Non-linear regression modelling for medical professionals; making curved paths straightforward},journal = {Postgraduate Medical Journal},pages = {qgaf183},year = {2025},month = {11},issn = {0032-5473},doi = {10.1093/postmj/qgaf183},url = {https://doi.org/10.1093/postmj/qgaf183},eprint = {https://academic.oup.com/pmj/advance-article-pdf/doi/10.1093/postmj/qgaf183/65131196/qgaf183.pdf},}

Learn more

See theStandardworkflow with restricted cubic splines vignette for a full workedexample.


[8]ページ先頭

©2009-2025 Movatter.jp