Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample sizes in the longitudinal and event processes differ. #49

Open
marazzoli opened this issue Feb 28, 2024 · 0 comments
Open

sample sizes in the longitudinal and event processes differ. #49

marazzoli opened this issue Feb 28, 2024 · 0 comments

Comments

@marazzoli
Copy link

          Hello there. Just starting with JM and having an issue that seems to be related to the size of the matrixes from the two sbumodels, even though they originate from the same df.

Your help would be greatly appreciated.

Here's the error that I get after running JMbayes2:

Error in jointModelBayes(mod_fi_onegroup, cox_fit, timeVar = "week") :
sample sizes in the longitudinal and event processes differ.

this is the reprex() {though it differs from the error message above}
#longitudinal submodel
mod_fi_onegroup=lme(fi ~ week + one_group,
random= ~ week|id,
corr=corAR1(form = ~ 1|id),
control=lmeControl(opt='optim'),
data=fi.long, method="REML",
na.action = na.exclude)
#> Error in lme(fi ~ week + one_group, random = ~week | id, corr = corAR1(form = ~1 | : could not find function "lme"

#coxph time-to-event submodel
cox_fit<-coxph(Surv(age_weeks, censored) ~ one_group + cluster (id),
data = fi.long, x=TRUE, model = TRUE)
#> Error in coxph(Surv(age_weeks, censored) ~ one_group + cluster(id), data = fi.long, : could not find function "coxph"

library(JMbayes2)
#> Warning: package 'JMbayes2' was built under R version 4.3.2
#> Loading required package: survival
#> Loading required package: nlme
#> Loading required package: GLMMadaptive
#> Warning: package 'GLMMadaptive' was built under R version 4.3.2
#> Loading required package: splines
joint_ca <- jm(cox_fit, mod_fi_onegroup, timeVar = "week")
#> Warning in jm(cox_fit, mod_fi_onegroup, timeVar = "week"): unknown names in
#> control: timeVar
#> Error in eval(expr, envir, enclos): object 'mod_fi_onegroup' not found

Originally posted by @marazzoli in #38 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant