| Title: | Terminal Trend Models on the Retrospective Time Scale |
|---|---|
| Description: | Fits retrospective-time longitudinal models for terminal trend analysis using weighted generalized estimating equations and related joint modeling tools. The package provides functions to estimate spline-based baseline and treatment effect trajectories on the retrospective time scale, obtain pointwise confidence intervals, and visualize fitted trajectories. |
| Authors: | Tingchang Wang [aut], Zhigang Li [aut, cre] |
| Maintainer: | Zhigang Li <[email protected]> |
| License: | GPL-2 |
| Version: | 0.1.0 |
| Built: | 2026-10-27 20:23:17 UTC |
| Source: | https://github.com/cran/TTM |
Computes the estimated treatment effect trajectory,
, at user-supplied retrospective time points from a fitted
TTM() or RetroJM() object.
The trajectory is formed from the treatment main effect together with the treatment-by-spline interaction terms in the fitted retrospective-time longitudinal model. Pointwise confidence intervals are constructed using a normal approximation based on the estimated covariance matrix of the fixed effects.
get_beta_A(new_times, results, conf.level = 0.95)get_beta_A(new_times, results, conf.level = 0.95)
new_times |
Numeric vector of retrospective time points
|
results |
A fitted object returned by |
conf.level |
Numeric scalar giving the confidence level for pointwise
confidence intervals. Must be strictly between |
For a fitted retrospective-time model of the form
this function evaluates at specified
The spline basis is reconstructed using the boundary knots and internal knots
stored in results, so the supplied new_times should be on the same
retrospective-time scale as used when fitting the model.
Confidence intervals are pointwise, not simultaneous.
A named list with components:
The input retrospective time points in new_times.
Estimated treatment effect values
.
Pointwise standard errors of the estimated treatment effect trajectory.
Lower pointwise confidence limits.
Upper pointwise confidence limits.
TTM(), get_beta_mu(), plot_beta_A()
fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) trt_eff <- get_beta_A( new_times = seq(0, 10, by = 1), results = fit, conf.level = 0.95 ) trt_eff$estimate trt_eff$CI.lower trt_eff$CI.upperfit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) trt_eff <- get_beta_A( new_times = seq(0, 10, by = 1), results = fit, conf.level = 0.95 ) trt_eff$estimate trt_eff$CI.lower trt_eff$CI.upper
Evaluates the estimated baseline longitudinal trajectory on the retrospective
timescale, denoted by , at user-supplied time points.
Pointwise normal approximation confidence intervals are returned based on
the weighted GEE fixed effect estimates from a fitted TTM() or RetroJM() object.
get_beta_mu(new_times, results, conf.level = 0.95)get_beta_mu(new_times, results, conf.level = 0.95)
new_times |
A numeric vector of retrospective time points at which the baseline trajectory is to be evaluated. |
results |
A fitted object returned by |
conf.level |
A numeric confidence level for the pointwise confidence
interval. Must be strictly between |
The baseline trajectory corresponds to the mean spline-based effect of
retrospective time for the reference treatment group and baseline covariate
pattern encoded by the model intercept-like term X0 and spline terms.
For a fitted retrospective-time model of the form
this function evaluates at specified
The spline basis is reconstructed using the boundary knots and internal knots
stored in results, so the supplied new_times should be on the same
retrospective-time scale as used when fitting the model.
Confidence intervals are pointwise, not simultaneous.
A list containing:
The user-supplied retrospective time points.
The estimated baseline trajectory .
The pointwise standard error of the estimated trajectory.
The lower bound of the pointwise confidence interval.
The upper bound of the pointwise confidence interval.
TTM(), get_beta_A(), plot_beta_mu()
fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) baseline <- get_beta_mu( new_times = seq(0, 10, by = 1), results = fit, conf.level = 0.95 ) baseline$estimate baseline$CI.lower baseline$CI.upperfit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) baseline <- get_beta_mu( new_times = seq(0, 10, by = 1), results = fit, conf.level = 0.95 ) baseline$estimate baseline$CI.lower baseline$CI.upper
Plots the estimated treatment effect trajectory,
, together with pointwise confidence intervals from a
fitted TTM() or RetroJM() object.
The plotted trajectory is formed from the treatment main effect together with the treatment-by-spline interaction terms in the fitted retrospective-time longitudinal model. Pointwise confidence intervals are constructed using a normal approximation based on the estimated covariance matrix of the fixed effects.
plot_beta_A(results, xlim = NULL, conf.level = 0.95)plot_beta_A(results, xlim = NULL, conf.level = 0.95)
results |
A fitted object returned by |
xlim |
Optional numeric vector of length 2 giving the range of
retrospective time to display. If |
conf.level |
Numeric scalar giving the confidence level for pointwise
confidence intervals. Must be strictly between |
This function evaluates the treatment effect trajectory over a fine grid of retrospective time values and plots the estimated curve together with its lower and upper pointwise confidence limits.
The spline basis is reconstructed using the boundary knots and internal knots
stored in results, so the plotted time axis should be interpreted on the
same retrospective-time scale used when fitting the model.
Confidence intervals are pointwise, not simultaneous.
Invisibly returns a named list with components:
The ggplot2 plot object.
The retrospective time grid used for plotting.
Estimated treatment effect values
.
Pointwise standard errors of the estimated treatment effect trajectory.
Lower pointwise confidence limits.
Upper pointwise confidence limits.
TTM(), get_beta_A(), plot_beta_mu()
fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) plot_beta_A( results = fit, xlim = c(0, 10), conf.level = 0.95 )fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) plot_beta_A( results = fit, xlim = c(0, 10), conf.level = 0.95 )
Plots the estimated baseline retrospective trajectory,
, together with pointwise confidence intervals from a
fitted TTM() or RetroJM() object.
The plotted trajectory is formed from the intercept-like baseline term together with the spline terms in the fitted retrospective-time longitudinal model. Pointwise confidence intervals are constructed using a normal approximation based on the estimated covariance matrix of the fixed effects.
plot_beta_mu(results, xlim = NULL, conf.level = 0.95)plot_beta_mu(results, xlim = NULL, conf.level = 0.95)
results |
A fitted object returned by |
xlim |
Optional numeric vector of length 2 giving the range of
retrospective time to display. If |
conf.level |
Numeric scalar giving the confidence level for pointwise
confidence intervals. Must be strictly between |
This function evaluates the baseline trajectory over a fine grid of retrospective time values and plots the estimated curve together with its lower and upper pointwise confidence limits.
The spline basis is reconstructed using the boundary knots and internal knots
stored in results, so the plotted time axis should be interpreted on the
same retrospective-time scale used when fitting the model.
Confidence intervals are pointwise, not simultaneous.
Invisibly returns a named list with components:
The ggplot2 plot object.
The retrospective time grid used for plotting.
Estimated baseline trajectory values
.
Pointwise standard errors of the estimated baseline trajectory.
Lower pointwise confidence limits.
Upper pointwise confidence limits.
TTM(), get_beta_mu(), plot_beta_A()
fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) plot_beta_mu( results = fit, xlim = c(0, 10), conf.level = 0.95 )fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros" ) plot_beta_mu( results = fit, xlim = c(0, 10), conf.level = 0.95 )
RetroJM()
A simulated long-format data set with repeated measurements of a
longitudinal outcome before death or censoring. It is used in the
vignette of RetroJM(). It has the same structure as TTM_data.
Retro_dataRetro_data
A data frame with 3586 rows (1000 subjects) and 17 variables:
Subject identifier.
Binary treatment indicator (0 = control, 1 = treatment).
Binary baseline covariate.
Non-negative continuous baseline covariate.
Subject-level random effect generated in the simulation.
Random intercept for the longitudinal outcome.
Random slope generated for the longitudinal outcome.
Observed time, the minimum of the death, dropout, and censoring times (months).
Event indicator: 0 = censored, 1 = death, 2 = dropout.
Death indicator (1 = death observed).
Dropout indicator (1 = dropout observed).
Simulated (latent) death time.
Simulated (latent) dropout time.
Simulated (latent) administrative censoring time.
Prospective measurement time since baseline.
True retrospective time, death_time - t_pros.
Longitudinal outcome.
Simulated data.
data("Retro_data", package = "TTM") head(Retro_data)data("Retro_data", package = "TTM") head(Retro_data)
Fits a two-stage retrospective joint modeling procedure. In stage 1, a Cox proportional hazards model is fit to overall survival and used to impute death times for censored individuals. In stage 2, the imputed datasets are used to fit a linear mixed effects model for the longitudinal outcome measured on a retrospective timescale from death. Fixed effects estimates and associated uncertainty are then pooled across imputations using standard multiple imputation combining rules.
RetroJM( data_long, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", death = "death", t_pros = "t_pros", random_effects = c("1", "A"), n_impute = 10, n_inner_knot = 3 )RetroJM( data_long, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", death = "death", t_pros = "t_pros", random_effects = c("1", "A"), n_impute = 10, n_inner_knot = 3 )
data_long |
A long-format |
id |
A character string giving the name of the subject identifier column. Each unique value should correspond to one individual. |
treatment |
A character string giving the name of the treatment or exposure variable. This variable is included in both the survival and longitudinal models. It is typically binary, but other codings may be used if supported by the model specification. |
outcome |
A character string giving the name of the longitudinal outcome variable to be modeled, such as a quality-of-life score. |
covariates |
A character vector of baseline covariate names to include as adjustment variables in both the survival and longitudinal submodels. |
os_time |
A character string giving the name of the overall survival time variable. This should represent observed event or censoring time on the prospective timescale. |
death |
A character string giving the name of the event indicator variable.
This should typically be coded as |
t_pros |
A character string giving the name of the prospective follow-up time variable for each longitudinal observation. This is used together with survival time to define retrospective time from death or imputed death. |
random_effects |
A character vector specifying the random effects terms to
include in the linear mixed effects model. For example, |
n_impute |
A positive integer giving the number of imputed death times, and therefore the number of imputed datasets, to generate for censored subjects. Larger values generally improve stability of pooled estimates at the cost of increased computation time. |
n_inner_knot |
A positive integer giving the number of internal knots used for the natural spline basis that models the retrospective time trend in the longitudinal submodel. Increased number of knots may improve the model capacity to capture complicated trajectories at the risk of capturing noises. |
This function implements a two-stage approach for analyzing longitudinal outcomes that are conceptually aligned by time before death.
Cox proportional hazards model:
Longitudinal linear mixed effect Model:
In the first stage, a Cox proportional hazards model is fit using treatment and baseline covariates. For subjects who are censored, conditional survival distributions beyond the censoring time are derived from the fitted Cox model, and death times are multiply imputed.
In the second stage, each imputed dataset is reconstructed by replacing censored survival times with imputed death times and fit the longitudinal process on the retrospective timescale. Then a natural spline basis is constructed on the retrospective time scale to capture the baseline trajectory and treatment caused trajectory for outcome variable, and a linear mixed effects model is fit to the longitudinal outcome.
The longitudinal model includes treatment, baseline covariates, spline terms
for retrospective time, and treatment-by-spline interactions. Random effects
are included according to random_effects by user specification.
Fixed effects estimates and covariance matrices from the mixed models are pooled across imputations using Rubin-style combining rules. Variance components are summarized by simple averaging across imputations.
This function assumes that:
data_long is in long format, with repeated outcome measurements per subject,
survival and censoring information are available at the subject level,
the longitudinal outcome is observed prior to death or censoring,
covariates included in the models are measured consistently across rows.
A named list with components:
The survival model formula used in the Cox model.
The fitted survival::coxph object from stage 1.
The linear mixed effects model formula used in stage 2.
A matrix of imputed death times for censored subjects, with one column per imputation and one row per censored subject.
A list containing pooled results from the longitudinal mixed effects models:
Pooled fixed effects estimates.
Pooled covariance matrix of the fixed effects estimates.
Average residual variance across imputations.
Average random effects covariance parameters across imputations.
Boundary knots used for the natural spline basis.
Internal knots used for the natural spline basis.
The number of internal knots used.
A lookup table showing original variable names and any internally transformed names used during preprocessing.
library(TTM) data("Retro_data", package = "TTM") fit <- RetroJM( data_long = Retro_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", death = "death", t_pros = "t_pros", random_effects = c("1", "A"), n_impute = 10, n_inner_knot = 3 ) fit$pooled_longitudinal_model$fixed_effects fit$pooled_longitudinal_model$fixed_effects_vcov plot_beta_mu(fit, xlim = c(0, quantile(Retro_data$OS_time, 0.7)), conf.level = 0.95) plot_beta_A(fit, xlim = c(0, quantile(Retro_data$OS_time, 0.7)), conf.level = 0.95) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)library(TTM) data("Retro_data", package = "TTM") fit <- RetroJM( data_long = Retro_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", death = "death", t_pros = "t_pros", random_effects = c("1", "A"), n_impute = 10, n_inner_knot = 3 ) fit$pooled_longitudinal_model$fixed_effects fit$pooled_longitudinal_model$fixed_effects_vcov plot_beta_mu(fit, xlim = c(0, quantile(Retro_data$OS_time, 0.7)), conf.level = 0.95) plot_beta_A(fit, xlim = c(0, quantile(Retro_data$OS_time, 0.7)), conf.level = 0.95) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)
Computes the change in slope of either the baseline trajectory or the
treatment-effect trajectory around a knot and tests its significance.
This function is for TTM_linear() fits with a B-spline basis
(spline_type = "bs") only.
test_beta_slope(new_times, fit, var_name)test_beta_slope(new_times, fit, var_name)
new_times |
Numeric vector of knot positions. Needs to be of length 3 where the middle value is the knot and the other two values are slightly before and after the knot. |
fit |
A fitted |
var_name |
Either |
A data.frame with columns slope1 (slope before the knot),
slope2 (slope after the knot), diff (slope2 - slope1), se_diff
(standard error of diff), and p_value (two-sided Wald test p-value).
fit_linear <- TTM_linear( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = 6, spline_type = "bs" ) test_beta_slope(new_times = c(5, 6, 7), fit = fit_linear, var_name = "X0") test_beta_slope(new_times = c(5, 6, 7), fit = fit_linear, var_name = "A")fit_linear <- TTM_linear( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = 6, spline_type = "bs" ) test_beta_slope(new_times = c(5, 6, 7), fit = fit_linear, var_name = "X0") test_beta_slope(new_times = c(5, 6, 7), fit = fit_linear, var_name = "A")
Fits a retrospective-time longitudinal model using weighted generalized estimating equations (WGEE).
Retrospective time is the time from prospective follow-up time to the death time. A natural spline basis is constructed for retrospective time to allow flexible terminal-time trajectories. To account for informative dropout and administrative censoring, subject-specific weights are estimated. The weighted longitudinal mean model is then fit with a Gaussian GEE among subjects with observed death events.
Uncertainty for the regression coefficients is estimated using a delete-group jackknife.
TTM( data_long, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", jk_block_size = NULL, n_inner_knot_list = range(10), corstr = "ar1", criteria = "RJC" )TTM( data_long, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", jk_block_size = NULL, n_inner_knot_list = range(10), corstr = "ar1", criteria = "RJC" )
data_long |
A long-format |
id |
Character scalar giving the subject identifier column name. |
treatment |
Character scalar giving the treatment column name. |
outcome |
Character scalar giving the longitudinal outcome column name. |
covariates |
Character vector of baseline covariate column names. |
os_time |
Character scalar giving the observed survival time column name. |
event |
Character scalar giving the event indicator column name.
The function assumes |
t_pros |
Character scalar giving the prospective follow-up time column name. |
jk_block_size |
Positive integer giving the number of delete-group jackknife groups used to estimate coefficient variability. Must be greater than 1. |
n_inner_knot_list |
Positive integer vector giving the candidates of number of internal knots for the natural spline basis in retrospective time. The final value will be selected using criteria. |
corstr |
Character scalar specifying the working correlation structure
passed to |
criteria |
Character scalar naming the model selection criterion,
computed by |
The fitted longitudinal model includes:
where and are represented by a
natural spline basis, and where is the
death time.
Dropout weights are derived from a Cox model for the hazard of dropout and
empirical estimates of censoring. The GEE fit is obtained with weights.
Only observations from subjects with event == 1 are used in the final
longitudinal model fit.
A named list with components:
The formula used to fit the dropout Cox model.
A fitted survival::coxph object for dropout.
The formula used in the weighted GEE fit.
A list containing:
Jackknife mean of the GEE coefficient estimates.
Delete-group jackknife covariance matrix for
fixed_effects.
Standard errors from
fixed_effects_vcov.
Matrix of leave-group-out coefficient estimates, one row per jackknife replicate.
Boundary knots used for the retrospective-time natural spline basis.
Internal knots used for the retrospective-time natural spline basis.
The requested number of internal spline knots.
Mapping between original variable names and the standardized names created during preprocessing.
A data.frame containing subject-level analysis weights.
Character string identifying the fitted method, equal to
"TTM".
library(TTM) data("TTM_data", package = "TTM") fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", jk_block_size = NULL, n_inner_knot_list = range(10), corstr = "ar1" ) fit$weighted_gee$fixed_effects fit$weighted_gee$fixed_effects_vcov plot_beta_mu( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) plot_beta_A( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)library(TTM) data("TTM_data", package = "TTM") fit <- TTM( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", jk_block_size = NULL, n_inner_knot_list = range(10), corstr = "ar1" ) fit$weighted_gee$fixed_effects fit$weighted_gee$fixed_effects_vcov plot_beta_mu( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) plot_beta_A( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)
TTM()
A simulated long-format data set with repeated measurements of a
longitudinal outcome before death, dropout, or censoring. It is used in the
examples and the vignette of TTM() and TTM_linear(). The script used to
generate the data is in the data-raw folder of the source repository.
TTM_dataTTM_data
A data frame with 3681 rows (1000 subjects) and 17 variables:
Subject identifier.
Binary treatment indicator (0 = control, 1 = treatment).
Binary baseline covariate.
Non-negative continuous baseline covariate.
Subject-level random effect generated in the simulation.
Random intercept for the longitudinal outcome.
Random slope generated for the longitudinal outcome.
Observed time, the minimum of the death, dropout, and censoring times (months).
Event indicator: 0 = censored, 1 = death, 2 = dropout.
Death indicator (1 = death observed).
Dropout indicator (1 = dropout observed).
Simulated (latent) death time.
Simulated (latent) dropout time.
Simulated (latent) administrative censoring time.
Prospective measurement time since baseline.
True retrospective time, death_time - t_pros.
Longitudinal outcome.
Simulated data.
data("TTM_data", package = "TTM") head(TTM_data) table(TTM_data$event[!duplicated(TTM_data$id)])data("TTM_data", package = "TTM") head(TTM_data) table(TTM_data$event[!duplicated(TTM_data$id)])
Fits a retrospective-time longitudinal model using weighted generalized estimating equations (WGEE).
Retrospective time is the time from prospective follow-up time to the death time. A natural spline basis is constructed for retrospective time to allow flexible terminal-time trajectories. To account for informative dropout and administrative censoring, subject-specific weights are estimated. The weighted longitudinal mean model is then fit with a Gaussian GEE among subjects with observed death events.
Uncertainty for the regression coefficients is estimated using a delete-group jackknife.
TTM_linear( data_long, id = "id", treatment = NULL, outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = NULL, jk_block_size = NULL, corstr = "ar1", spline_type = "bs", criteria = "RJC" )TTM_linear( data_long, id = "id", treatment = NULL, outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = NULL, jk_block_size = NULL, corstr = "ar1", spline_type = "bs", criteria = "RJC" )
data_long |
A long-format |
id |
Character scalar giving the subject identifier column name. |
treatment |
Character scalar giving the treatment column name. Can only accept NULL or binary group indicator. |
outcome |
Character scalar giving the longitudinal outcome column name. |
covariates |
Character vector of baseline covariate column names. |
os_time |
Character scalar giving the observed survival time column name. |
event |
Character scalar giving the event indicator column name.
The function assumes |
t_pros |
Character scalar giving the prospective follow-up time column name. |
knots |
Knots specified in advance. If null, the knot is selected automatically |
jk_block_size |
Positive integer giving the number of delete-group jackknife groups used to estimate coefficient variability. Must be greater than 1. |
corstr |
Character scalar specifying the working correlation structure
passed to |
spline_type |
Character scalar specifying the type of spline basis to
use. Options are |
criteria |
Currently unused; accepted for consistency with |
The fitted longitudinal model includes:
where and are represented by a
natural spline basis, and where is the
death time.
Dropout weights are derived from a Cox model for the hazard of dropout and
empirical estimates of censoring. The GEE fit is obtained with weights.
Only observations from subjects with event == 1 are used in the final
longitudinal model fit.
A named list with components:
The formula used to fit the dropout Cox model.
A fitted survival::coxph object for dropout.
The formula used in the weighted GEE fit.
A list containing:
Jackknife mean of the GEE coefficient estimates.
Delete-group jackknife covariance matrix for
fixed_effects.
Standard errors from
fixed_effects_vcov.
Matrix of leave-group-out coefficient estimates, one row per jackknife replicate.
Boundary knots used for the retrospective-time natural spline basis.
Internal knots used for the retrospective-time natural spline basis.
The requested number of internal spline knots.
Mapping between original variable names and the standardized names created during preprocessing.
A data.frame containing subject-level analysis weights.
Character string identifying the fitted method, equal to
"TTM".
library(TTM) data("TTM_data", package = "TTM") fit <- TTM_linear( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = 6, jk_block_size = NULL, spline_type = "bs", corstr = "ar1" ) fit$weighted_gee$fixed_effects fit$weighted_gee$fixed_effects_vcov plot_beta_mu( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) plot_beta_A( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)library(TTM) data("TTM_data", package = "TTM") fit <- TTM_linear( data_long = TTM_data, id = "id", treatment = "A", outcome = "Y", covariates = c("X1", "X2"), os_time = "OS_time", event = "event", t_pros = "t_pros", knots = 6, jk_block_size = NULL, spline_type = "bs", corstr = "ar1" ) fit$weighted_gee$fixed_effects fit$weighted_gee$fixed_effects_vcov plot_beta_mu( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) plot_beta_A( fit, xlim = c(0, stats::quantile(TTM_data$OS_time, 0.7)), conf.level = 0.95 ) get_beta_mu(new_times = 1:10, results = fit, conf.level = 0.95) get_beta_A(new_times = 1:10, results = fit, conf.level = 0.95)