Learn R Programming

postcard (version 1.1.0)

rctglm_methods: 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 rctglm estimand(object)

est(object)

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

# S3 method for rctglm predict(object, ...)

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

Value

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

See coef() and predict.glm() for details on what is returned by the corresponding methods.

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 class rctglm, which extracts coefficient information from the underlying glm fit in the procedure. The same is true for the method defined for the predict() generic. The method for an rctglm class object calls predict.glm() on the glm fit contained within an rctglm object.

See Also

The generic rctglm() which produces rctglm class objects.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab