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

Error in Xderiv %*% fixef(lmeObject)[derivForm$indFixed] : non-conformable arguments #23

Closed
yugangjia opened this issue Nov 2, 2020 · 1 comment

Comments

@yugangjia
Copy link

yugangjia commented Nov 2, 2020

Hi, @drizopoulos,
I am trying to use derivForm with splines and getting the following error:
"Error in Xderiv %*% fixef(lmeObject)[derivForm$indFixed] :
non-conformable arguments"

Can anyone show an example how to set the derivForm when you use splines in the linear mixed effect model?
Here is my code

fitLME_poly <- lme(sofa_recent ~ ns(hr_day, 3)*ethnicity+U_sofa_adm+age10+male,
random = list(stay_id = pdDiag(form = ~ ns(hr_day, 3))), data = mdat)
fitCox_poly <- coxph(Surv(icu_day,died) ~ ethnicity+age10+male+U_sofa_adm,data=mdat.id,x=TRUE)

dForm <- list(fixed = ~ dns(hr_day, 3) + dns(hr_day, 3)*ethnicity, indFixed = c(2,3,4,11,12,13,14,15,16,17,18,19),
random = ~ dns(hr_day, 3) , indRandom = c(2,3,4))

fitJM_pwph_poly <- jointModel(fitLME_poly,fitCox_poly,timeVar="hr_day",
method="piecewise-PH-aGH",
parameterization = "both", derivForm = dForm,
control=list(verbose=TRUE,iter.EM=100))
Thanks

@drizopoulos
Copy link
Owner

drizopoulos commented Nov 3, 2020

There are example in my course notes, and sample script files in my website.

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

2 participants