This package helps with building and conveying regression models. Ithas also a few functions for handlingrobustconfidence intervals for the ols() regression in the rms-package. Itis closely interconnected with the the Gmisc, htmlTable, and theforestplot packages.
Communicating statistical results is in my opinion just as importantas performing the statistics. Often effect sizes may seem technical toclinicians but putting them into context often helps and makes you toget your point across.
The method that I most frequently use in this package is theprintCrudeAndAdjustedModel. It generates a table that hasthe full model coefficients together with confidence intervals alongsidea crude version using only that single variable. This allows the user toquickly gain insight into how strong each variable is and how itinteracts with the full model, e.g. a variable that shows a large changewhen adding the other variables suggests that there is significantconfounding. See the vignette for more details,vignette("Print_crude_and_adjusted_models").
I also like to use forest plots for conveying regression models. Acommon alternative to tables is to use a forest plot with estimates andconfidence intervals displayed in a graphical manner. The actual numbersof the model may be better suited for text while the graphs quickly tellhow different estimates relate.
Sometimes we also have situations where one needs to choose betweentwo models, e.g. aPoissonregression and aCoxregression. This package provides aforestplotCombineRegrObj function that allows you tosimultaneously show two models and how they behave in differentsettings. This is also useful when performing sensitivity analyses andcomparing different selection criteria, e.g. only selecting the patientswith high-quality data and see how that compares.
TheplotHR function was my first attempt at doingsomething more advanced version based upon Reinhard Seifert’s originaladaptation of thestats::termplot function. It has someneat functionality although I must admit that I now often useggplot2 for many of my plotsas I like to have a consistent look throughout the plots. The functionhas though a neat way of displaying the density of the variable at thebottom.
Much of our modeling ends up a little repetitive and this packagecontains a set of functions that I’ve found useful. The approach that Ihave for modeling regressions is heavily influenced byFrank Harrell’sregressionmodeling strategies. The core idea consist of:
addNonLinearityfunction. The function tests usingANOVA fornon-linearity and if such is found it maps a set of knots, e.g. 2-7knots, of a spline function and then checks for the model with thelowest AIC/BIC value. If it is the main variable I do this by hand toavoid choosing a too complex model when the AIC/BIC values are verysimilar but for confounders I’ve found this a handy approach.robcov_alt method. In survival analyses thenon-proportional hazards assumption can sometimes be violated where thetimeSplitter function helps you to set-up a dataset thatallows you to build time-interaction models (seevignette("timeSplitter") for details).