mlm.output.statlong.call: Call a linear regression model and reorganize its output

Description Usage Arguments Value Author(s) Examples

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

Description

sucessfull error handling for errors on function calls when groups are empty

Usage

1

Arguments

mula

a formula for a lm() regression provided as character using the column names of the data

data

the data table with the column names

...

additional arguments to call lm() such as weights and other lm arguments

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
DT = as.data.table(mtcars)
DT[, mlm.output.statlong.call(mula = "mpg ~ drat + gear", data = .SD) , by = list(am) ]
# impose an error with a nonexisting column name
DT[, mlm.output.statlong.call(mula = "mpg ~ drat + gear + bogus", data = .SD) , by = list(am) ]
# use ... to weight the regression
DT[, mlm.output.statlong.call(mula = "mpg ~ drat + gear", data = .SD, weight = cyl) , by = list(am) ]

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