summary functions
added July 22, 2010
Code File
The code for the lm.mysummary(), glm.mysummary(), gee.mysummary(), and geese.mysummaries() functions are contained in the file mysummaries.R. You can source the file directly into R by calling
source("http://www.biostat.jhsph.edu/~pmurakam/mysummaries.R")The code is licensed under the GNU General Public License version 3, or (at your option) any later version.
Manual page
Description: The summary() function may not give you a satisfactory summary table. Use these functions instead to obtain the summary table portion of the summary() function that includes confidence intervals (by normal approximation or, optionally for glms, profile likelihood), p-values whose number of significant digits is adustable, and appropriately exponentiated and labeled results for logistic and poisson regressions. Usage: lm.mysummary( fit, alpha=.05, dig=3, p.dig=4, ci="profile.lik") glm.mysummary(fit, alpha=.05, dig=3, p.dig=4, ci="profile.lik") geese.mysummary (fit, alpha=.05, dig=3, p.dig=4) gee.mysummary(fit, alpha=.05, dig=3, p.dig=4) Arguments: fit - lm model object for lm.mysummary, glm model object for glm.mysummary, geese model object for geese.mysummary, and gee model object for gee.mysummary alpha - significance level ci - for use in glm.mysummary(), either "profile.lik" for a profile likelihood- based confidence interval (preferred) or "normal.approx" for a normal approximation- based confidence interval. dig - number of significant digits to report for all values except the p-value p.dig - number of significant digits to report for the p-value Aside: Note that, unless family is independence or exchangeable, gee() and geese() both need the data set to be sorted by time within subject, and missing measurements for a subject should be still be given a row in the data set (with NAs (but no NAs in the id or time columns)). Also, the geese function assumes that no values are missing. Hence if one measurement is missing on a subject, then this subject has to be excluded from the analysis.