rctglm_methods: Methods for objects of class 'rctglm'

rctglm_methodsR Documentation

Methods for objects of class rctglm

Description

Methods mostly to extract information from model fit and inference. See details for more information on each method.

Usage

estimand(object)

## S3 method for class 'rctglm'
estimand(object)

est(object)

## S3 method for class 'rctglm'
coef(object, ...)

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

Arguments

object

an object of class rctglm

...

additional arguments passed to methods

x

an object of class rctglm

digits

a numeric with the number of digits to display when printing

Details

The function estimand (or short-hand version est) can be used to extract a data.frame with an estimated value and standard error of the estimand.

A method for the generic coef has been added for rctglm (i.e., coef.rctglm), which uses the method coef.glm to extract coefficient information from the underlying glm fit in the procedure.

Value

estimand/est returns a data.frame with columns Estimate and ⁠Std. Error⁠ with the estimate and standard error of the estimand.

coef returns a named numeric, being the result of the glm method of coef on the glm object contained within an rctglm object.

See Also

The generic rctglm() which these are methods for.

Examples

# Generate some data to showcase example
n <- 100
exposure_prob <- .5
dat_binom <- glm_data(
  Y ~ 1+1.5*X1+2*A,
  X1 = rnorm(n),
  A = rbinom(n, 1, exposure_prob),
  family = binomial()
)

# Fit the model
ate <- rctglm(formula = Y ~ .,
              exposure_indicator = A,
              exposure_prob = exposure_prob,
              data = dat_binom,
              family = binomial,
              estimand_fun = "ate")

print(ate)
estimand(ate)
coef(ate)

postcard documentation built on April 12, 2025, 1:57 a.m.