tests/testthat/test_jmcs.R

myEps <- if (capabilities("long.double")) .Machine$double.eps else 1e-9

test_that(" joint model (jmcs)",
          {
            fit <- jmcs(ydata = ydata, cdata = cdata, 
                        long.formula = response ~ time + gender + x1 + race, 
                        surv.formula = Surv(surv, failure_type) ~ x1 + gender + x2 + race, 
                        random =  ~ time| ID)
            
            expect_equal(mean(fit$beta), 0.29819263, tolerance = (10 ^ 8) * myEps)
            expect_equal(fit$loglike, -8989.389, tolerance = (10 ^ 12) * myEps)
            
 
          })

Try the FastJM package in your browser

Any scripts or data that you put into this service are public.

FastJM documentation built on May 29, 2024, 8:39 a.m.