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

Functions

addNonlinearity Man page
addNonlinearity.negbin Man page
bread.ols Man page
caDescribeOpts Man page
cbind.printCrudeAndAdjusted Man page
confint.ols Man page
confint_robust Man page
estfun.ols Man page
forestplotCombineRegrObj Man page
forestplotRegrObj Man page
fpBoxSize Man page
getCrudeAndAdjustedModelData Man page
[.getCrudeAndAdjustedModelData Man page
getModelData4Forestplot Man page
Greg-package Man page
hatvalues.ols Man page
htmlTable.printCrudeAndAdjusted Man page
isFitCoxPH Man page
isFitLogit Man page
knit_print.printCrudeAndAdjusted Man page
latex.printCrudeAndAdjusted Man page
model.matrix.ols Man page
plotHR Man page
prCaAddRefAndStat Man page
prCaAddReference Man page
prCaAddUserReferences Man page
prCaDefaultGetCoefAndCI Man page
prCaGetImputationCols Man page
prCaGetRowname Man page
prCaGetVnStats Man page
prCaPrepareCrudeAndAdjusted Man page
prCaReorder Man page
prCaReorderReferenceDescribe Man page
prCaRmsGetCoefAndCI Man page
prCaSelectAndOrderVars Man page
prCaSetRownames Man page
prClearPCAclass Man page
prConvertShowMissing Man page
prEnvModelCall Man page
prExtractOutcomeFromModel Man page
prFindRownameMatches Man page
prGetFpDataFromFit Man page
prGetFpDataFromGlmFit Man page
prGetFpDataFromSurvivalFit Man page
prGetModelData Man page
prGetModelVariables Man page
prGetStatistics Man page
[.printCrudeAndAdjusted Man page
printCrudeAndAdjustedModel Man page
print.printCrudeAndAdjusted Man page
print.simpleRmsAnova Man page
prMapVariable2Name Man page
prNlChooseDf Man page
prPhConfIntPlot Man page
prPhDensityPlot Man page
prPhEstimate Man page
prPhNewData Man page
prPhRugPlot Man page
prPrintCAstring Man page
rbind.printCrudeAndAdjusted Man page
robcov_alt Man page
simpleRmsAnova Man page
timeSplitter Man page

Files

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.

Please suggest features or report bugs with the GitHub issue tracker.

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