Greg: Regression Helper Functions

Methods for manipulating regression models and for describing these in a style adapted for medical journals. Contains functions for generating an HTML table with crude and adjusted estimates, plotting hazard ratio, plotting model estimates and confidence intervals using forest plots, extending this to comparing multiple models in a single forest plots. In addition to the descriptives methods, there are addons for the robust covariance matrix provided by the sandwich package, a function for adding non-linearities to a model, and a wrapper around the Epi package's Lexis functions for time-spliting a dataset when modeling non-proportional hazards in Cox regressions.

AuthorMax Gordon [aut, cre], Reinhard Seifert [aut] (Author of original plotHR)
Date of publication2016-03-28 23:24:58
MaintainerMax Gordon <max@gforge.se>
LicenseGPL (>= 3)
Version1.2
http://gforge.se

View on CRAN

Man pages

addNonlinearity: Add a nonlinear function to the model

bread.ols: Getting the bread for the vcovHC

caDescribeOpts: A function for gathering all the description options

confint.ols: A confint function for the ols

confint_robust: The confint function adapted for vcovHC

estfun.ols: Fix for the Extract Empirical Estimating Functions

forestplotCombineRegrObj: Compares different scores in different regression objects.

forestplotRegrObj: Forest plot for multiple models

GetCoefAndCI: Get the confidence intervals

getCrudeAndAdjustedModelData: This function helps with printing regression models

getModelData4Forestplot: Get model data

Greg-package: Regression Helper Functions

hatvalues.ols: Get the hat matrix for the OLS

isFitFn: Functions for checking regression type

model.matrix.ols: A fix for the model.matrix

plotHR: Plot a spline in a Cox regression model

prCaAddRefAndStat: Add reference according to the model

prCaAddReference: Adds a reference to value matrix

prCaAddUserReferences: Adds references

prCaGetImputationCols: Function for retrieving the imputation arguments

prCaGetRowname: Gets the labelled rowname if it exists

prCaGetVnStats: Gets the variable stats

prCaPrepareCrudeAndAdjusted: Prettify the text

prCaReorder: Reorder according to the requested variables

prCaReorderReferenceDescribe: Adds the ordering, references, and descriptions

prCaSelectAndOrderVars: Re-order variables

prCaSetRownames: Sets the rownames of the reordered_groups

prClearPCAclass: Removes the printCrudeAndAdjusted class from arguments

prConvertShowMissing: A functuon for converting a useNA variable

prEnvModelCall: Runs an 'fastDoCall' within the environment of the model

prExtractOutcomeFromModel: Get model outcome

prFindRownameMatches: Looks for unique rowname match without grep

prGetFpDataFromFit: Gets the confidence interval, p-values, coefficients from a...

prGetFpDataFromGlmFit: Gets the boundaries for a GLM fit that is poisson or...

prGetFpDataFromSurvivalFit: Gets the boundaries for a survival fit

prGetModelData: Get model data.frame

prGetModelVariables: Get the models variables

prGetStatistics: Get statistics according to the type

printCrudeAndAdjustedModel: Output crude and adjusted model data

prMapVariable2Name: A function that tries to resolve what variable corresponds to...

prNlChooseDf: Chooses the degrees of freedom for the non-linearity

prPhConfIntPlot: Plots the confidence intervals

prPhDensityPlot: Plot a density on the datapoints

prPhEstimate: Gets the non-linear function's estimate

prPhNewData: A function for retrieving new_data argument for predict

prPhRugPlot: Plot a rug on the datapoints

prPrintCAstring: Prep for printing

robcov_alt: Robust covariance matrix based upon the sandwich-package

SimpleRmsAnova: A simpler latex output of the latex.anova.rms

timeSplitter: A function for splitting a time according to time periods

Files in this package

Greg
Greg/inst
Greg/inst/examples
Greg/inst/examples/printCrudeAndAdjustedModel_example.R
Greg/inst/examples/plotHR_example.R
Greg/inst/examples/forestplotRegrObj_example.R
Greg/inst/examples/getCphRegrObjData_example.R
Greg/inst/examples/timeSplitter_example.R
Greg/inst/examples/simpleRmsAnova_example.R
Greg/inst/examples/addNonlinearity_example.R
Greg/inst/examples/printSimpleFit_example.R
Greg/inst/examples/rms_SandwichAddon_example.R
Greg/inst/examples/getCrudeAndAdjustedModelData_example.R
Greg/inst/examples/isFitLogit_example.R
Greg/inst/examples/forestplotCombineRegrObj_example.R
Greg/inst/examples/isFitCoxPH_example.R
Greg/inst/examples/confint_robust_example.R
Greg/inst/doc
Greg/inst/doc/Print_crude_and_adjusted_models.html
Greg/inst/doc/Print_crude_and_adjusted_models.Rmd
Greg/inst/doc/timeSplitter.Rmd
Greg/inst/doc/timeSplitter.html
Greg/inst/doc/Print_crude_and_adjusted_models.R
Greg/inst/doc/timeSplitter.R
Greg/tests
Greg/tests/test-interval-timeSplitter.R
Greg/tests/test-nonlin_4_coxph.R
Greg/tests/testthat.R
Greg/tests/testthat
Greg/tests/testthat/test-plotHR.R
Greg/tests/testthat/test-addNonlinearity.R
Greg/tests/testthat/test-private_functions.R
Greg/tests/testthat/test-getCrudeAndAdjustedModelData.R
Greg/tests/testthat/test-simpleRmsAnova.R
Greg/tests/testthat/test-forestplotRegrObj.R
Greg/tests/testthat/test-confint_robust.R
Greg/tests/testthat/test-printCrudeAndAdjustedModel.R
Greg/tests/testthat/test-fit.mult.impute-C&A.R
Greg/tests/testthat/test-isFit.R
Greg/tests/testthat/test-timeSplitter.R
Greg/tests/testthat/test-forestplotCombineRegrObj.R
Greg/NAMESPACE
Greg/NEWS
Greg/R
Greg/R/isFitCoxPH.R Greg/R/confint_robust.R Greg/R/simpleRmsAnova.R Greg/R/forestplotRegrObj.R Greg/R/rms_SandwichAddon.R Greg/R/getModelData4Forestplot.R Greg/R/getCrudeAndAdjustedModelData.rms.R Greg/R/printCrudeAndAdjustedModel.R Greg/R/private_printCaA.R Greg/R/forestplotCombineRegrObj.R Greg/R/addNonlinearity.R Greg/R/private_functions.R Greg/R/private_plotHR.R Greg/R/plotHR.R Greg/R/private_getCaA.R Greg/R/isFitLogit.R Greg/R/Greg.R Greg/R/timeSplitter.R Greg/R/getCrudeAndAdjustedModelData.R
Greg/vignettes
Greg/vignettes/Print_crude_and_adjusted_models.Rmd
Greg/vignettes/timeSplitter.Rmd
Greg/README.md
Greg/MD5
Greg/build
Greg/build/vignette.rds
Greg/DESCRIPTION
Greg/man
Greg/man/prGetFpDataFromSurvivalFit.Rd Greg/man/timeSplitter.Rd Greg/man/prCaAddRefAndStat.Rd Greg/man/SimpleRmsAnova.Rd Greg/man/prCaPrepareCrudeAndAdjusted.Rd Greg/man/bread.ols.Rd Greg/man/prPhDensityPlot.Rd Greg/man/prEnvModelCall.Rd Greg/man/prGetModelData.Rd Greg/man/prGetFpDataFromFit.Rd Greg/man/prFindRownameMatches.Rd Greg/man/prPhEstimate.Rd Greg/man/prCaSelectAndOrderVars.Rd Greg/man/prCaReorder.Rd Greg/man/prPhNewData.Rd Greg/man/model.matrix.ols.Rd Greg/man/prCaAddReference.Rd Greg/man/prClearPCAclass.Rd Greg/man/prGetStatistics.Rd Greg/man/plotHR.Rd Greg/man/forestplotRegrObj.Rd Greg/man/prCaAddUserReferences.Rd Greg/man/prPrintCAstring.Rd Greg/man/prMapVariable2Name.Rd Greg/man/isFitFn.Rd Greg/man/estfun.ols.Rd Greg/man/prCaReorderReferenceDescribe.Rd Greg/man/prCaSetRownames.Rd Greg/man/Greg-package.Rd Greg/man/getCrudeAndAdjustedModelData.Rd Greg/man/addNonlinearity.Rd Greg/man/caDescribeOpts.Rd Greg/man/forestplotCombineRegrObj.Rd Greg/man/getModelData4Forestplot.Rd Greg/man/confint.ols.Rd Greg/man/prExtractOutcomeFromModel.Rd Greg/man/prGetFpDataFromGlmFit.Rd Greg/man/prCaGetVnStats.Rd Greg/man/prNlChooseDf.Rd Greg/man/prGetModelVariables.Rd Greg/man/printCrudeAndAdjustedModel.Rd Greg/man/prCaGetRowname.Rd Greg/man/prConvertShowMissing.Rd Greg/man/confint_robust.Rd Greg/man/robcov_alt.Rd Greg/man/prPhRugPlot.Rd Greg/man/prPhConfIntPlot.Rd Greg/man/hatvalues.ols.Rd Greg/man/prCaGetImputationCols.Rd Greg/man/GetCoefAndCI.Rd

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.