Skip to content

Commit

Permalink
version 24.3.25
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Rustand authored and cran-robot committed Mar 26, 2024
1 parent 0e055be commit 8b99923
Show file tree
Hide file tree
Showing 51 changed files with 1,451 additions and 288 deletions.
13 changes: 7 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: INLAjoint
Type: Package
Title: Multivariate Joint Modeling for Longitudinal and Time-to-Event
Outcomes with 'INLA'
Version: 24.2.4
Version: 24.3.25
Authors@R: c(
person("Denis", "Rustand", email = "INLAjoint@gmail.com",
role = c("cre", "aut"),
Expand All @@ -24,18 +24,19 @@ BugReports: https://github.com/DenisRustand/INLAjoint/issues
Encoding: UTF-8
LazyData: true
Depends: R (>= 3.6), utils, stats
Imports: numDeriv, lme4, ggplot2, methods, Matrix
Imports: numDeriv, lme4, ggplot2, methods, Matrix, nlme, mvtnorm
Additional_repositories: https://inla.r-inla-download.org/R/testing
RoxygenNote: 7.2.3
Suggests: INLA, knitr, rmarkdown, splines, graphics, grDevices, R.rsp
RoxygenNote: 7.3.1
Suggests: INLA, knitr, rmarkdown, splines, graphics, grDevices, R.rsp,
survival, JMbayes2, rstanarm, frailtypack, smcure
BuildVignettes: true
VignetteBuilder: R.rsp
Maintainer: Denis Rustand <INLAjoint@gmail.com>
NeedsCompilation: no
Packaged: 2024-02-04 08:26:40 UTC; dr
Packaged: 2024-03-25 08:20:45 UTC; dr
Author: Denis Rustand [cre, aut] (<https://orcid.org/0000-0001-9708-5220>),
Elias Teixeira Krainski [aut] (<https://orcid.org/0000-0002-7063-2615>),
Haavard Rue [aut] (<https://orcid.org/0000-0002-0222-1881>),
Janet van Niekerk [aut] (<https://orcid.org/0000-0002-4334-2057>)
Repository: CRAN
Date/Publication: 2024-02-04 11:30:06 UTC
Date/Publication: 2024-03-25 19:50:02 UTC
71 changes: 46 additions & 25 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,43 +1,64 @@
f8fa5557b7a30a4bb0fba0a559164e6b *DESCRIPTION
691b869d4d9adbeab8b5e25d5bbd453e *NAMESPACE
93dcba9c920f6dfc023cc5955918995d *R/INLAjoint.R
21e027bad13804187d99ae14932c9a58 *R/INLAjoint.object.R
df7ecef15ec0a4d439faada441e0d656 *R/Long.R
0024819970717a87a54bbde4901d0df0 *DESCRIPTION
e6e192cee4dfdd3237057f92d37ac457 *NAMESPACE
e87abe7bb9bead6bd6ffa0ab4df6e1b6 *R/INLAjoint.R
af5a94fc4b44e69bd727821d67043423 *R/INLAjoint.object.R
af146bd1fe869d7e1688305932f51855 *R/LongMS.R
ffc4d6b39d824c8bd06a6bf2b1370160 *R/Surv.R
3226228f418cfebdae2238906c4e3e3b *R/Longsim.R
a1cd2c8308deb214a786964d1f277b86 *R/SurvMS.R
5f63e7220da5837112b8d5065598e558 *R/joint.R
d96fbdec2d94ea44108a8ae3769e2bbf *R/Survsim.R
fb92a29f90cea91c1bf62961a6372a4b *R/coef.INLAjoint.R
7808a64e4737202f120d8fe78c4a733e *R/family.INLAjoint.R
b530b2f48c61324037b8193fdd45a627 *R/fitted.INLAjoint.R
81441f864e8b83894b5eeb3a6656df44 *R/fixef.INLAjoint.R
a59472d3821558332b9ce788c411ab4b *R/formula.INLAjoint.R
3299d29ed77eb9cd20c822bf2b272e77 *R/joint.R
ef5f512cb9d831bd3202b080ade79fdb *R/joint.rerun.R
923637a7d129c28892a1a379ebaab570 *R/plot.INLAjoint.R
3d42997b7e9f31f362a4f7c7c75b48a0 *R/predict.INLAjoint.R
6a74f214c8c6c5f34b2451b9a6dd758a *R/print.INLAjoint.R
19248cb0be4ced08f207f6cf1dbea1f6 *R/logLik.INLAjoint.R
f80616ba9238b3ecc5f89b85038d4fe0 *R/nobs.INLAjoint.R
1c7a1c17a3cae7c609ecc1df37943b5e *R/plot.INLAjoint.R
b28c62e7a1e97b8c384da582cbc5329d *R/predict.INLAjoint.R
bfdc0ac0d1c9e45959c752e3c598205c *R/print.INLAjoint.R
7e9e5299096a276cd2451ac3ac632abf *R/print.plot.INLAjoint.R
27da5bd1c6b5ea73181f752f2447a1fb *R/print.summary.INLAjoint.R
bc018df9c34a92d1da31400a891b2ddf *R/priors.used.R
0032549b4e0daa4f52b867875cdfbab1 *R/setupFonctions.R
8797279037cd8f4e670b25807c90df52 *R/summary.INLAjoint.R
a77d47d03d397b7ecfb9ec4ba892bd0b *R/ranef.INLAjoint.R
d19dff023c5991fa7b9b7ca8812e20f1 *R/setupFonctions.R
b7f75540ce9ed7643098a946a34b914a *R/summary.INLAjoint.R
1a26dbd399d695c749b83355f75f74da *R/zzz.R
6e3e5a2bbbf227d9fb3ea1f78a7ed5cf *README.md
6f16682a7369682d5b76e03957a713f9 *build/vignette.rds
6af0c18c4fba79580c32357fba3349e3 *data/Long.RData
0d392216e2a12fe512b450d87cb03395 *README.md
1f840d027d39dcaad94c12b7d37f1e39 *build/vignette.rds
43765ba9ca3e5cb9f339b81c3277e720 *data/LongMS.RData
27f1fbc94a5c0a77eca3db79a42fb70d *data/Surv.RData
1defc23b0ba5826b1e2354ef53392733 *data/Longsim.RData
e1f25fe275136fa60827f03ccb3b8cf8 *data/SurvMS.RData
5f2cb91231bd7c719a351a9135194260 *data/Survsim.RData
3a5b15390022c51e1e2f932fb0953d4c *inst/CITATION
a1522831209570de2724d5b5219d8bc6 *inst/doc/INLAjoint.pdf
3fecba890bbdaf695a813cb17e5a2c8a *inst/doc/INLAjoint.pdf
dcdacf5c9841484e6defa5380b731e81 *inst/doc/INLAjoint.pdf.asis
d57fb6ec5d6bacf287aad11fb8e1f28e *man/INLAjoint.Rd
0408f6752e4b3c9d47d206e46470896e *man/INLAjoint.object.Rd
9febe1e66f54b24ae4bd8cefc8aafb92 *man/Long.Rd
ce410e59c252cf9bdca61e8591bed93a *man/INLAjoint.Rd
3449d51e7a9ffd6d21cb932927e048a9 *man/INLAjoint.ginv.Rd
f81c2a22cdbae70506d02f55c9e1af7d *man/INLAjoint.object.Rd
447027c837f9705ccdc4ab1bd914d070 *man/INLAjoint.rw.Rd
50a748b007bb4b5e0adbaa930c525f15 *man/INLAjoint.rw2.Rd
9c5bd37d67fbe1a5e738352760520bee *man/INLAjoint.scopy.define.Rd
c5d52e9c31477cfc93eca23b6a7f0215 *man/LongMS.Rd
3a65f53aaee7e1ff5c825ae7188d9b97 *man/Surv.Rd
e49bfa62a801a33409931cdf633b5a03 *man/Longsim.Rd
c42360f8c8c5a61d7a18e45311b5eb6f *man/SurvMS.Rd
86c4c74aa5be69fc5eff697164aac5b3 *man/joint.Rd
5c137bc76d8a6b417aa9f44b0c7671be *man/Survsim.Rd
ded14fc63c06e786a9d0dedb8ed77826 *man/coef.INLAjoint.Rd
516032e488ed7eef61195eb21d85bb88 *man/family.INLAjoint.Rd
bfdd10ca4312f15ad559bc82d84374fb *man/fitted.INLAjoint.Rd
64dd898299e66683e80bbc8ab76417d6 *man/fixef.INLAjoint.Rd
2e3bb2bdd9e5e58024faefe6a9368fc7 *man/formula.INLAjoint.Rd
876714bec890e201a18fd67f77cdd90f *man/joint.Rd
d77f56002f98cab9179f1502d1fa66fd *man/joint.rerun.Rd
cabf34db3c560016f3d3d431b6adf6c4 *man/logLik.INLAjoint.Rd
0a153d08ce7c7ef69c8b67e9a1168418 *man/nobs.INLAjoint.Rd
f9d30faf45dd1976215cc84487c03d46 *man/plot.INLAjoint.Rd
cd990675ed41473066f5d899f4b2a996 *man/priors.used.Rd
a7482c94c853f2fcc7a7665f826898b1 *man/predict.INLAjoint.Rd
fba00c06d66840f2884f412681bd2c5e *man/print.plot.INLAjoint.Rd
2770352767ad4cd1c49354cab1cfe6de *man/ranef.INLAjoint.Rd
1b28e67718b7bdf174eb1e568e53b3cc *man/setup_FE_model.Rd
46e86834ea16b38cc86757095f77565a *man/setup_RE_model.Rd
89171c3aa65a6f5d1d417fa7b755f62f *man/setup_S_model.Rd
fcf10d59f5c52f516888994a1917fc09 *man/setup_Y_model.Rd
d70db68fb30c3d9048c8472a64a4aa95 *vignettes/INLAjoint.Rmd
434f33703577de5562646c5765b2fb3c *vignettes/INLAjoint.Rmd
dcdacf5c9841484e6defa5380b731e81 *vignettes/INLAjoint.pdf.asis
16 changes: 15 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
# Generated by roxygen2: do not edit by hand

S3method(coef,INLAjoint)
S3method(family,INLAjoint)
S3method(fitted,INLAjoint)
S3method(fixef,INLAjoint)
S3method(formula,INLAjoint)
S3method(logLik,INLAjoint)
S3method(nobs,INLAjoint)
S3method(plot,INLAjoint)
S3method(predict,INLAjoint)
S3method(print,INLAjoint)
S3method(print,plot.INLAjoint)
S3method(print,summary.INLAjoint)
S3method(ranef,INLAjoint)
S3method(summary,INLAjoint)
export(INLAjoint)
export(joint)
export(joint.rerun)
export(priors.used)
export(setup_S_model)
import(ggplot2)
import(stats)
import(utils)
importFrom(Matrix,Diagonal)
importFrom(Matrix,bdiag)
importFrom(grDevices,dev.flush)
importFrom(grDevices,dev.interactive)
importFrom(grDevices,dev.new)
importFrom(grDevices,devAskNewPage)
importFrom(lme4,findbars)
importFrom(lme4,nobars)
importFrom(lme4,subbars)
importFrom(methods,new)
importFrom(nlme,fixef)
importFrom(nlme,ranef)
importFrom(numDeriv,grad)
importFrom(splines,ns)
5 changes: 3 additions & 2 deletions R/INLAjoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
#'
#' Contact: \email{INLAjoint@gmail.com}
#'
#' @docType package
#' @name INLAjoint
#' @export

INLAjoint <- function() {
message("Welcome to the INLAjoint package!")
#utils::browseVignettes("INLAjoint")
utils::vignette("INLAjoint")
}
32 changes: 31 additions & 1 deletion R/INLAjoint.object.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' \item{\code{mlik}}{log marginal-likelihood.}
#' \item{\code{cpo}}{Conditional Predictive Ordinate.}
#' \item{\code{gcpo}}{Group-Conditional Predictive Ordinate.}
#' \item{\code{po}}{.}
#' \item{\code{po}}{Predictive ordinate.}
#' \item{\code{waic}}{Widely applicable Bayesian information criterion}
#' \item{\code{model.random}}{a vector with the name of the random parameters of
#' the model, possibly including the following components: \describe{
Expand Down Expand Up @@ -59,7 +59,37 @@
#' \item{\code{all.hyper}}{.}
#' \item{\code{.args}}{.}
#' \item{\code{call}}{INLA call.}
#' \item{\code{selection}}{information about parameters for sampling with inla.rjmarginal.}
#' \item{\code{cureVar}}{informations about cure fraction submodel for mixture cure survival models.}
#' \item{\code{variant}}{information about variant for Weibull baseline hazards.}
#' \item{\code{SurvInfo}}{some information about survival submodels (names of event
#' indicator and event time variables as well as baseline hazard).}
#' \item{\code{famLongi}}{list of distributions for the longitudinal markers.}
#' \item{\code{corLong}}{boolean indicating if random effects are correlated accross markers.}
#' \item{\code{control.link}}{informations about link function (1=default).}
#' \item{\code{longOutcome}}{name of longitudinal outcomes.}
#' \item{\code{survOutcome}}{name of survival outcomes.}
#' \item{\code{assoc}}{vector with names of all association parameters (longi-surv).}
#' \item{\code{id}}{name of the id variable.}
#' \item{\code{timeVar}}{name of time variable.}
#' \item{\code{range}}{information about range of X-axis values for non-linear associations.}
#' \item{\code{REstruc}}{names of the grouped random effects for the longitudinal markers.}
#' \item{\code{mat_k}}{contains the list of random effects covariance matrices when they are
#' fixed as they are not part of the estimated parameters (used for displaying them in summary).}
#' \item{\code{fixRE}}{list of the size of number of groups of random effects, each element is a
#' boolean indicating if the random effects of the group is fixed (TRUE) or estimated (FALSE).}
#' \item{\code{lonFacChar}}{list of factors and character covariates included in the longitudinal
#' submodels to keep track of modalities (used internally when doing predictions to reconstruct
#' categorical covariates).}
#' \item{\code{survFacChar}}{same as lonFacChar but for survival submodels.}
#' \item{\code{corRE}}{list indicating if groups of random effects are correlated within
#' longitudinal submodels.}
#' \item{\code{basRisk}}{list of the baseline risk used for each survival submodel.}
#' \item{\code{priors_used}}{informations about priors used in the model, internally used
#' to display priors in plots (with argument priors=TRUE in the call of the plot function).
#' Note that priors can also be displayed with the function priors.used() applied to an
#' INLAjoint object.}
#' \item{\code{dataLong}}{name of the longitudinal dataset.}
#' \item{\code{dataSurv}}{name of the survival dataset.}
#' }
"INLAjoint.object" <- NULL
6 changes: 3 additions & 3 deletions R/Long.R → R/Longsim.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Simulated multivariate longitudinal dataset
#'
#' A simulated dataset used to illustrate some models (e.g., example of joint() function in the documentation). The corresponding survival dataset is named 'Surv'.
#' A simulated dataset used to illustrate some models (e.g., example of joint() function in the documentation). The corresponding survival dataset is named 'Survsim'.
#'
#' @format ## `Long`
#' @format ## `Longsim`
#' A data frame with 96 rows and 7 columns:
#' \describe{
#' \item{Id}{Individual id}
Expand All @@ -12,4 +12,4 @@
#' \item{Y1, Y2, Y3}{Gaussian Longitudinal outcomes}
#' ...
#' }
"Long"
"Longsim"
6 changes: 3 additions & 3 deletions R/Surv.R → R/Survsim.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Simulated competing risks survival dataset
#'
#' A simulated dataset used to illustrate some models (e.g., example of joint() function in the documentation). The corresponding longitudinal dataset is named 'Long'.
#' A simulated dataset used to illustrate some models (e.g., example of joint() function in the documentation). The corresponding longitudinal dataset is named 'Longsim'.
#'
#' @format ## `Surv`
#' @format ## `Survsim`
#' A data frame with 15 rows and 5 columns:
#' \describe{
#' \item{Id}{Individual id}
Expand All @@ -12,4 +12,4 @@
#' \item{Event1, Event2, Event3}{Event indicator for the 3 competing risks (individual is censored when the 3 events are 0)}
#' ...
#' }
"Surv"
"Survsim"
24 changes: 24 additions & 0 deletions R/coef.INLAjoint.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#' Extracts model coefficients from a given model fitted with INLAjoint
#'
#' @description This function extracts model coefficients from INLAjoint objects.
#'
#' @param object an object that contains a model fitted with INLAjoint.
#' @param ... Extra arguments.
#'
#' @export

coef.INLAjoint <- function(object, ...){
arguments <- list(...)
FEF <- object$summary.fixed
HYP <- object$summary.hyperpar
OUtc <- list("Fixed_effects" = FEF, "Hyperparameters" = HYP)
return(OUtc)
}








31 changes: 31 additions & 0 deletions R/family.INLAjoint.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#' Extracts family from a given model fitted with INLAjoint
#'
#' @description This function extracts family from INLAjoint objects.
#'
#' @param object an object that contains a model fitted with INLAjoint.
#' @param ... Extra arguments.
#'
#' @export

family.INLAjoint <- function(object, ...){
arguments <- list(...)
if(!is.null(object$formLong)){
Long <- object$famLongi
}else{
Long <- NULL
}
if(!is.null(object$formSurv)){
Surv <- unlist(object$basRisk)
}else{
Surv <- NULL
}
return(list("Longitudinal" = Long, "Survival" = Surv))
}








25 changes: 25 additions & 0 deletions R/fitted.INLAjoint.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#' Extracts fitted values from a given model fitted with INLAjoint
#'
#' @description This function extracts fitted values from INLAjoint objects.
#' Values are associated to a name to keep track of the outcome related to each fitted value.
#'
#' @param object an object that contains a model fitted with INLAjoint.
#' @param ... Extra arguments.
#'
#' @export

fitted.INLAjoint <- function(object, ...){
arguments <- list(...)
PRED <- object$summary.fitted.values$mean
OUtc <- as.data.frame(object$.args$data$Yjoint)
names(PRED) <- sapply(1:length(PRED), function(x) colnames(OUtc)[which(!is.na(OUtc[x,]))])
return(PRED)
}








0 comments on commit 8b99923

Please sign in to comment.