trajhrmsm_pltmle {trajmsm} | R Documentation |
History Restricted MSM and Latent Class of Growth Analysis estimated with a Pooled LTMLE.
Description
Estimate parameters of LCGA-HRMSM using a Pooled LTMLE.
Usage
trajhrmsm_pltmle(
degree_traj = c("linear", "quadratic", "cubic"),
treatment,
covariates,
baseline,
outcome,
ntimes_interval,
total_followup,
time,
time_values,
identifier,
var_cov,
number_traj = 3,
family = "poisson",
obsdata,
treshold = 0.99
)
Arguments
degree_traj |
To specify the polynomial degree for modelling the time-varying treatment. |
treatment |
Name of time-varying treatment. |
covariates |
Names of time-varying covariates (should be a list). |
baseline |
Names of baseline covariates. |
outcome |
Name of the outcome variable. |
ntimes_interval |
Length of a time-interval (s). |
total_followup |
Total length of follow-up. |
time |
Name of the time variable. |
time_values |
Measuring times. |
identifier |
Name of the column for unique identifiant. |
var_cov |
Names of the time-varying covariates. |
number_traj |
Number of trajectory groups. |
family |
Specification of the error distribution and link function to be used in the model. |
obsdata |
Data in a long format. |
treshold |
For weight truncation. |
Value
A list containing the following components:
- results_hrmsm_pltmle
Matrix of estimates for LCGA-HRMSM, obtained using the pooled ltlmle method.
- restraj
Fitted trajectory model.
- mean_adh
Matrix of the mean adherence per trajectory group.
Author(s)
Awa Diop Denis Talbot
Examples
obsdata_long = gendata(n = 1000, format = "long",
total_followup = 8, timedep_outcome = TRUE, seed = 945)
baseline_var <- c("age","sex")
years <- 2011:2018
variables <- c("hyper", "bmi")
covariates <- lapply(years, function(year) {
paste0(variables, year)})
treatment_var <- paste0("statins", 2011:2018)
var_cov <- c("statins","hyper", "bmi","y")
respltmle = trajhrmsm_pltmle(degree_traj = "linear", treatment = treatment_var,
covariates = covariates, baseline = baseline_var,
outcome = paste0("y", 2016:2018),var_cov = var_cov, ntimes_interval = 6,
total_followup = 8, time = "time",time_values = years, identifier = "id",
number_traj = 3, family = "poisson", obsdata = obsdata_long)
respltmle$results_hrmsm_pltmle