data(data_3class)
## One covariate
out1 <- clus_lme(fixed_formula = Y ~ X1, name_class = "D",
name_clust = "id_Clus", data = data_3class)
### Estimate TCFs at one single value of X1, (t1, t2) = (1, 4)
out_tcfs_1 <- clus_tcfs(out_clus_lme = out1, newdata = data.frame(X1 = 1),
thresholds = c(1, 4), ap_var = TRUE)
print(out_tcfs_1)
## Two covariates
out2 <- clus_lme(fixed_formula = Y ~ X1 + X2, name_class = "D",
name_clust = "id_Clus", data = data_3class)
### Estimate covariate-specific TCFs at point (X1, X2) = (1, 0), and (t1, t2) = (1, 4)
out_tcfs_2 <- clus_tcfs(out_clus_lme = out2,
newdata = data.frame(X1 = 1, X2 = 0),
thresholds = c(1, 4), ap_var = TRUE)
print(out_tcfs_2)
### Estimate covariate-specific TCFs at three points and (t1, t2) = (1, 4)
out_tcfs_3 <- clus_tcfs(out_clus_lme = out2,
newdata = data.frame(X1 = c(-0.5, 0.5, 0.5),
X2 = c(0, 0, 1)),
thresholds = c(1, 4), ap_var = TRUE)
print(out_tcfs_3)
Run the code above in your browser using DataLab