mlm.output.statlong: Reorganize the output of a regression fit into a statistic |...

Description Usage Arguments Value Author(s) Examples

View source: R/data.table.regression.utils.R

Description

simple function which takes a lm model output to create a named vector intended for use with data.table and group by

Usage

1

Arguments

fit

object returned from a linear model function lm() and quantreg::rq() are supported

Value

a data.table with columns statistic and value

Author(s)

Maik Renner, mrenner [at] bgc-jena.mpg.de

Examples

1
2
3
4
5
6
7
# output of regression model is melted to two columns
data(mtcars)
fitlm = lm(formula = "mpg ~ drat + gear", data = mtcars)
mlm.output.statlong(fitlm)
# example for group by operation with data.table power
DT = as.data.table(mtcars)
DT[, mlm.output.statlong(lm(formula = "mpg ~ drat + gear", .SD) ), by = list(am) ]

laubblatt/phaselag documentation built on Sept. 30, 2020, 11:21 a.m.