survatr
  1. Reference
  2. print.survatr_fit
  • Home
  • Getting started
    • Introduction
  • Estimation methods
    • IPW (Track A)
    • ICE / longitudinal (Track B)
    • Competing risks (CIF)
  • Reference
    • contrast
    • contrast.survatr_fit
    • forrest
    • forrest.survatr_result
    • plot.survatr_result
    • print.survatr_fit
    • print.survatr_result
    • surv_fit
    • tidy
    • tidy.survatr_result
  • News
  • License
  • Citation

On this page

  • Print a survatr_fit
    • Description
    • Usage
    • Arguments
    • Value
    • See Also
    • Examples

Code Links

  1. Reference
  2. print.survatr_fit

Print a survatr_fit

Description

Minimal banner summary for the fit object returned by surv_fit(). Reports the track, estimator, outcome / treatment / id / time columns, number of individuals, number of person-period rows used to fit, and the time grid span. A richer print (coef table, time-spline degrees of freedom) ships with the contrast / S3 polish in a later chunk.

Usage

## S3 method for class 'survatr_fit'
print(x, ...)

Arguments

x A survatr_fit.
… Unused.

Value

The fit object, invisibly.

See Also

Other survatr_fit functions: surv_fit()

Examples

library("survatr")

set.seed(1)
n_id <- 30L
K <- 4L
pp <- data.frame(
  id = rep(seq_len(n_id), each = K),
  t = rep(seq_len(K), times = n_id),
  A = rep(rbinom(n_id, 1L, 0.5), each = K),
  Y = rbinom(n_id * K, 1L, 0.1)
)
fit <- surv_fit(pp, "Y", "A", ~1, "id", "t", time_formula = ~ factor(t))
print(fit)
<survatr_fit>
  Track:       A
  Estimator:   gcomp
  Family:      binomial
  Outcome:     Y
  Treatment:   A
  ID:          id
  Time:        t
  Censoring:   none
  N:           30 individuals, 120 PP rows (104 at risk)
  Time grid:   [1, 4] (4 unique times)