Learn R Programming

lame (version 1.3.4)

tidy.ame: Tidy method for fitted ame / lame objects

Description

Returns a data frame with one row per estimated coefficient, compatible with the broom idiom. For dynamic_beta fits (3-D BETA), returns one row per coefficient per period with a period column. Standard errors are posterior standard deviations; statistic is estimate / std.error.

Usage

# S3 method for ame
tidy(x, conf.int = TRUE, conf.level = 0.95, ...)

# S3 method for lame tidy(x, conf.int = TRUE, conf.level = 0.95, ...)

Value

Data frame with columns term, estimate, std.error, statistic, p.value, conf.low, conf.high, and (for dynamic_beta fits) period.

Arguments

x

A fitted ame / lame object.

conf.int

Logical; include 95\ (conf.low, conf.high). Default TRUE.

conf.level

Confidence level for the interval. Default 0.95.

...

Ignored.

Details

Note on p.value. This column is included for broom compatibility but is not a classical test. It is a two-sided Normal approximation based on the posterior mean and marginal posterior standard deviation, matching the calculation in summary(fit). Use it as a compact signal that the marginal posterior is far from zero, and report it alongside the conf.low / conf.high credible interval. When sign certainty matters, compute it directly from x$BETA, for example mean(sign(BETA) == sign(mean(BETA))).

Loaded as an S3 method against generics::tidy when the generics package is available; works as tidy(fit) either way once broom is loaded.

Examples

Run this code
# \donttest{
data(YX_bin_list)
fit <- lame(YX_bin_list$Y, YX_bin_list$X, family = "binary", R = 0,
            nscan = 100, burn = 20, odens = 5, verbose = FALSE)
tidy(fit)
# }

Run the code above in your browser using DataLab