rctglm_methods {postcard} | R 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 |
... |
additional arguments passed to methods |
x |
an object of class |
digits |
a |
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)