Description Usage Arguments Details Value Note Examples
A customized coefficient function that assigns better row
names to the coefficient matrix returned by
coef
() for a model fit. Also includes some
arguments for parsing of variable names.
1 2 |
fit |
the model fit we wish to generate coefficients from. |
remove_underscore |
remove underscores (and all elements after) in a variable? |
remove_dollar |
remove all elements before and including a $ in a variable name? |
swap_periods |
swap periods with spaces? |
NOTE:
Models with interaction effects are currently not handled.
a matrix of coefficients with nicely formatted names.
The names given assume default contrasts in your model fit;
ie, the default is contr.treatment
, where each level
of a factor is compared to a reference.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## How the remove_underscore and remove_dollar arguments act:
## An example:
## kDat$variable_other_stuff
## remove_underscore: +++++++++++++------------
## remove_dollar: -----++++++++++++++++++++
x <- rnorm(100); y <- x * runif(100)
z <- as.factor( rep( c("apple", "banana", "cherry", "date"), each=25 ) )
myFit <- lm( y ~ x + z )
## compare the output of these two: which do you prefer?
coef( summary( myFit ) )
kCoef( myFit )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.