Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
drizopoulos committed Apr 20, 2024
1 parent 2a90f37 commit ac96a04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Development/interval_CR.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,27 @@ eventDF$stop[eventDF$start == eventDF$stop] <- 1e-05
attr(eventDF$weight, "integrate") <- eventDF$intgr_


CoxFit <- coxph(Surv(start, stop, event) ~ DxAge + strata(strt), data = eventDF,
CoxFit <- coxph(Surv(start, stop, event) ~ density:strata(strt), data = eventDF,
weights = eventDF$weight, model = TRUE)

lmeFit <- lme(PSAValue ~ ns(time, k = c(1.49, 3.535), B = c(0, 10.223)) + DxAge,
data = train.dat,
random = list(CISNET_ID = pdDiag(form = ~ ns(time, k = c(1.49, 3.535), B = c(0, 10.223)))))

lmeFit <- lme(PSAValue ~ ns(time, k = c(1.49, 3.535), B = c(0, 10.223)) + DxAge,
data = train.dat,
random = ~ ns(time, k = c(1.49, 3.535), B = c(0, 10.223)) | CISNET_ID)
lmeFit <- lme(PSAValue ~ ns(time, df = 3) + DxAge,
data = train.dat, control = lmeControl(opt = 'optim'),
random = ~ ns(time, df = 3) | CISNET_ID)

jmFit <- jm(CoxFit, lmeFit, time_var = "time",
functional_forms = ~ value(PSAValue):strt +
slope(PSAValue,eps = 1, direction = "back"):strt,
n_iter = 6500L, n_burnin = 2500L)
n_iter = 6500L, n_burnin = 500L)
summary(jmFit)

iccsjm.model$summary$coef



Surv_object = CoxFit
Mixed_objects = lmeFit
time_var = 'time'
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export(area, calibration_metrics, calibration_plot, cumuplot, coef, compare_jm,
import(Rcpp)
importFrom("utils", "glob2rx", "tail", "head", "combn")
importFrom("stats", "coef", "terms", "model.frame", "model.frame.default",
"model.matrix", "model.matrix.default", "family", "lm.fit", "sd",
"model.matrix", "model.matrix.default", "model.weights", "family",
"lm.fit", "sd",
"ar", "var", "vcov", "optim", "delete.response", "model.response",
"rnorm", "quantile", "runif", "rlnorm", "cov2cor", "as.formula",
"gaussian", ".getXlevels", "makepredictcall", "plogis",
Expand Down
2 changes: 1 addition & 1 deletion R/jm_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jm_fit <- function (model_data, model_info, initial_values, priors, control) {
id_h_ <- unlist(mapply2(function (x, ind) if (sum(ind) > 0) x[!duplicated(ind)] else x,
split(id_h, id_h), split(model_data$intgr_ind, id_h)))
} else {
id_h2 <- 0
id_h2 <- id_h_ <- 0
}
model_data <-
c(model_data, create_Wlong_mats(model_data, model_info,
Expand Down

0 comments on commit ac96a04

Please sign in to comment.