ttable | R Documentation |
lm
object
Works like summary
for an lm
object but adds AIC, AICc, and BIC to the output with the option to display VIFs.
ttable(obj, digits = 4, vif = FALSE, ...)
obj |
an object of class "lm" as a result of a call to |
digits |
the (approximate) number of significant digits to use when printing. |
vif |
if TRUE, variance inflation factors are printed if applicable; default is FALSE. |
... |
further arguments passed to or from other methods. |
Produces a t-table for an lm
object much like print.summary.lm
with added information including AIC, AICc, BIC, and VIF (if requested and if applicable), to the output. The output is rounded and there are no significance stars. In fact, there are no stars at all.
TO REPEAT THE WARNING ON USING 'lm' FOR TIME SERIES: Considerable care must be taken:
Include na.action = NULL
in the lm
call to avoid stripping the time series attributes from the variables before the regression is done.
If any lagged or differenced variables are used in 'lm', the series must be lined up first. In this case, prepare a data frame using ts.intersect(..., dframe = TRUE)
; e.g.,
mydata = ts.intersect(M = cmort, P4 = lag(part,-4), dframe=TRUE) fit = lm(M ~ P4, na.action=NULL, data=mydata) ttable(fit)
Prints a typical t-table with additional information as mentioned in the details.
The p-values are two-sided. Also silently returns the same values as described in summary.lm
.
D.S. Stoffer
Built using print.summary.lm
from the 'stats' package.
You can find demonstrations of astsa capabilities at FUN WITH ASTSA.
The most recent version of the package can be found at https://github.com/nickpoison/astsa/.
In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.
The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.
summary.lm
, print.summary.lm
, lm
fit1 = lm(cmort~ time(cmort) + tempr + I(tempr^2))
ttable(fit1, vif=TRUE)
# if you center `tempr`, the squared term doesn't change
temp = tempr - mean(tempr)
fit2 = lm(cmort~ time(cmort) + temp + I(temp^2))
ttable(fit2, vif=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.