d confidence intervals for model
+ estimates.
}
\section{Using time series}{
Considerable care is needed when using \code{lm} with time series.
De : Martin Maechler [mailto:maech...@stat.math.ethz.ch]
Envoyé : vendredi 17 janvier 2025 17:04
À : SOEIRO Thomas
Cc : r-devel@r-project.o
> SOEIRO Thomas via R-devel
> on Fri, 17 Jan 2025 14:19:31 + writes:
> Following Duncan Murdoch's off-list comments (thanks again!), here is a more
> complete/flexible version:
>
> as.data.frame.lm <- function(x, ..., level = 0.95, exp = FALSE) {
> cf <- x |> summary() |> stat
Following Duncan Murdoch's off-list comments (thanks again!), here is a more
complete/flexible version:
as.data.frame.lm <- function(x, ..., level = 0.95, exp = FALSE) {
cf <- x |> summary() |> stats::coef()
ci <- stats::confint(x, level = level)
if (exp) {
cf[, "Estimate"] <- exp(cf[,
Hello all,
Would there be any interest for adding as.data.frame() methods for model
objects?
Of course there is packages (e.g. broom), but I think providing methods would
be more discoverable (and the patch would be small).
It is really useful for exporting model results or for plotting.
e.g.: