|
1 | 1 | ### synthesize.R --- |
2 | 2 | #---------------------------------------------------------------------- |
3 | | -## Author: Johan Sebastian Ohlendorff Thomas Alexander Gerds |
| 3 | +## Author: Johan Sebastian Ohlendorff & Thomas Alexander Gerds |
4 | 4 | ## Created: Apr 28 2021 (09:04) |
5 | 5 | ## Version: |
6 | | -## Last-Updated: feb 12 2026 (12:14) |
7 | | -## By: Thomas Alexander Gerds |
8 | | -## Update #: 156 |
| 6 | +## Last-Updated: maj 21 2026 (14:54) |
| 7 | +## By: Brice Ozenne |
| 8 | +## Update #: 174 |
9 | 9 | #---------------------------------------------------------------------- |
10 | 10 | ## |
11 | 11 | ### Commentary: |
@@ -248,7 +248,7 @@ synthesize.lvm <- function(object, |
248 | 248 | ...){ |
249 | 249 | from.formula <- length(attr(object,"from.formula"))>0 |
250 | 250 | # check whether variables in model are in data set |
251 | | - if (!from.formula && !all(object$attributes$eventHistory$time$names %in% names(data))) { |
| 251 | + if (!from.formula && !all(object$attributes$eventHistory[[1]]$names %in% names(data))) { |
252 | 252 | stop("Time or status variable could not be found in data set.") |
253 | 253 | } |
254 | 254 | var.model <- colnames(object$M) |
@@ -507,7 +507,7 @@ synthesize.lvm <- function(object, |
507 | 507 | } |
508 | 508 | # Estimate regression coefficients in real data |
509 | 509 | # and add them to the lvm object using lava::regression |
510 | | - for(var in latent_vars[!(latent_vars %in% object$attributes$eventHistory$time$names)]){ |
| 510 | + for(var in latent_vars[!(latent_vars %in% object$attributes$eventHistory[[1]]$names)]){ |
511 | 511 | covariates <- get_covariates(object,var,dichotomized_variables) |
512 | 512 | reg_formula <- as.formula(paste0(var, "~", covariates)) |
513 | 513 | # we have three types of regression to deal with now. Either |
|
0 commit comments