Skip to contents

Produces a summary of a fitted amerasfit object, including parameter estimates, standard errors, and confidence intervals if computed via confint.

Usage

# S3 method for class 'amerasfit'
summary(object, ...)

# S3 method for class 'amerasfit'
summary_table(object, ...)

# S3 method for class 'summary.amerasfit'
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

object

A fitted model object of class amerasfit, as returned by ameras.

x

An object of class summary.amerasfit, as returned by summary.amerasfit.

digits

The number of significant digits to use. Defaults to max(3, getOption("digits") - 3).

...

Additional arguments, currently unused.

Value

summary.amerasfit returns an object of class summary.amerasfit, which is a list containing the following elements:

call

The matched call from the original call to ameras.

row_info

A list describing row handling during model fitting, including the number of rows supplied, omitted by na.action, and used for fitting. For conditional logistic regression, this also includes the number of rows excluded because they belong to uninformative matched sets.

summary_table

A data frame with one row per parameter per method, containing columns:

Method

The estimation method (RC, ERC, MCML, FMA, or BMA).

Term

The parameter name.

Estimate

The parameter estimate.

SE

The standard error.

CI.lower

The lower confidence bound, if confidence intervals have been computed via confint.

CI.upper

The upper confidence bound, if confidence intervals have been computed via confint.

Rhat

The Gelman-Rubin convergence diagnostic, included only when BMA results are present. Values above 1.05 indicate potential convergence problems.

n.eff

The effective sample size, included only when BMA results are present.

runtime_table

A data frame reporting computation time in seconds for each method. When structured timing information is available this has columns Method, Fit, CI, and Total, with CPU time reported for each timing component. For objects that only contain the compatibility runtime field, this has columns Method and Runtime.

total_runtime_seconds

The total CPU computation time in seconds across all methods.

CI.computed

Logical. TRUE if confidence intervals have been computed via confint, FALSE otherwise.

Details

summary.amerasfit collects results from all estimation methods present in the fitted object into a single summary table. Columns for confidence intervals are only printed if they have been computed by confint. When BMA results are present in the fitted object, the summary table includes columns Rhat and n.eff, with NA values for all other methods. Profile likelihood diagnostic columns such as pval.lower and pval.upper remain available in the stored CI component but are not printed in the summary table.

Printing the summary prints the original call to ameras, row counts, the CPU runtime (total and by method), and the table described above. Row counts are shown in the order applied during fitting: rows supplied, rows omitted by na.action, and rows used for fitting. For conditional logistic regression, the summary also reports rows excluded because they belong to uninformative matched sets, i.e., matched sets of size 1 or with no cases. When confidence intervals have been computed, CI runtime is included in the total runtime. This table can also be accessed directly (i.e., to retrieve confidence intervals) using summary_table.

See also

ameras for model fitting, confint for computing confidence intervals, print for a shorter printed summary, coef for extracting coefficients.

Examples

data("data", package = "ameras")

## Fit the model
fit <- ameras(Y.binomial~dose(V1:V10, model="ERR"), data = data, family = "binomial",
              methods = "RC")
#> Fitting RC

## Summary without confidence intervals
summary(fit)
#> Call:
#> ameras(formula = Y.binomial ~ dose(V1:V10, model = "ERR"), data = data, 
#>     family = "binomial", methods = "RC")
#> 
#> Rows:
#>   Supplied: 3000
#>   Omitted by na.action: 0
#>   Used for fitting: 3000
#> 
#> Total CPU runtime: 0 seconds
#> 
#> CPU runtime in seconds by method:
#> 
#>  Method   Fit  CI Total
#>      RC 0.049 0.0 0.049
#> 
#> Summary of coefficients by method:
#> 
#>  Method        Term Estimate      SE
#>      RC (Intercept)  -0.8847 0.07378
#>      RC        dose   0.8020 0.13751
#> 
#> Note: confidence intervals not yet computed. Use confint() to add them.
#> 

## Summary with confidence intervals
fit <- confint(fit, type = "wald.orig")
#> RC confidence intervals:
#> 
#>               lower   upper
#> (Intercept) -1.0293 -0.7401
#> dose         0.5324  1.0715
#> 
summary(fit)
#> Call:
#> ameras(formula = Y.binomial ~ dose(V1:V10, model = "ERR"), data = data, 
#>     family = "binomial", methods = "RC")
#> 
#> Rows:
#>   Supplied: 3000
#>   Omitted by na.action: 0
#>   Used for fitting: 3000
#> 
#> Total CPU runtime: 0 seconds
#> 
#> CPU runtime in seconds by method:
#> 
#>  Method   Fit    CI Total
#>      RC 0.049 0.001  0.05
#> 
#> Summary of coefficients by method:
#> 
#>  Method        Term Estimate      SE CI.lower CI.upper
#>      RC (Intercept)  -0.8847 0.07378  -1.0293  -0.7401
#>      RC        dose   0.8020 0.13751   0.5324   1.0715
#> 

## Access the summary table directly
s <- summary_table(fit)

## Multiple methods
# \donttest{
fit2 <- ameras(Y.binomial~dose(V1:V10, model="ERR"), data = data, family = "binomial",
              methods = c("RC", "ERC", "MCML"))
#> Fitting RC
#> Fitting ERC
#> Fitting MCML
fit2 <- confint(fit2, type = "wald.orig")
#> RC confidence intervals:
#> 
#>               lower   upper
#> (Intercept) -1.0293 -0.7401
#> dose         0.5324  1.0715
#> 
#> ERC confidence intervals:
#> 
#>               lower   upper
#> (Intercept) -1.0314 -0.7384
#> dose         0.5411  1.1018
#> 
#> MCML confidence intervals:
#> 
#>               lower   upper
#> (Intercept) -1.0193 -0.7323
#> dose         0.5236  1.0584
#> 
summary(fit2)
#> Call:
#> ameras(formula = Y.binomial ~ dose(V1:V10, model = "ERR"), data = data, 
#>     family = "binomial", methods = c("RC", "ERC", "MCML"))
#> 
#> Rows:
#>   Supplied: 3000
#>   Omitted by na.action: 0
#>   Used for fitting: 3000
#> 
#> Total CPU runtime: 77.2 seconds
#> 
#> CPU runtime in seconds by method:
#> 
#>  Method    Fit    CI  Total
#>      RC  0.049 0.001  0.050
#>     ERC 76.864 0.000 76.864
#>    MCML  0.320 0.001  0.321
#> 
#> Summary of coefficients by method:
#> 
#>  Method        Term Estimate      SE CI.lower CI.upper
#>      RC (Intercept)  -0.8847 0.07378  -1.0293  -0.7401
#>      RC        dose   0.8020 0.13751   0.5324   1.0715
#>     ERC (Intercept)  -0.8849 0.07477  -1.0314  -0.7384
#>     ERC        dose   0.8214 0.14304   0.5411   1.1018
#>    MCML (Intercept)  -0.8758 0.07323  -1.0193  -0.7323
#>    MCML        dose   0.7910 0.13644   0.5236   1.0584
#> 
# }