(update request by CRAN)
bs()to avoid warning in CMD check when run on older version of R where
splines::bs()did not yet have the argument
formula()now also return the model formula when
JM_imp()with ordinal longitudinal outcome is not using the correct version of the linear predictor in the quadrature procedure approximating the integral in the survival.
monitor_params(imps = TRUE)in survival models fixed.
predDF(): bugfix for models including auxiliary variables (which were previously not included into the data)
nonprop: bugfix for non-proportional effects in covariate models
add_samples()will now result in the
callelement of a
JointAIobject being a
listand no longer a nested list.
comp_infoelement of fitted
JointAIobject has changed due to the changes in parallel computing, and computational time is not reported separately for the adaptive phase and the sampling phase, and separately per chain when parallel computation was used.
predict()is now a lot faster for proportional hazards models.
custom: new argument in the main analysis functions that allows the user to replace the JAGS syntax for sub-models with custom syntax. The argument expects a named list where the names are the names of the variables for which the custom model will be used. This feature requires some knowledge of JAGS syntax.
append_data_list: new argument in the main analysis functions that allows the user to add elements to the list of data that is passed to JAGS. This may be necessary for custom sub-models.
rd_vcov: new argument in the main analysis functions that allows the specification of the structure of the random effects variance-covariance matrices in (multivariate) mixed models (and joint models).
plot_all()not displaying the variable name in the message shown for character string variables.
set_refcat(): wasn’t displaying the factor labels correctly
print.JointAI: bugfix for multivariate mixed models with full variance-covariance matrix of the random effects that had the same number of random effects for each outcome, for which the printing of this matrix resulted in an error.
rd_vcov(): new function added to extract the random effect variance- covariance matrices (posterior means)
*_imp()functions from within another function that has the model formula as an argument.
data_list: omit data matrix
ncol == 0
data_list: syntax to checking which
pos_*to include can handle the case with multiple grouping variables being on the same, lowest level; before
pos_*was excluded for only one of them
add_samples(): remove unnecessary call to
predDF()bug fix: the parameter for all methods is now called
list_models()now also works for errored JointAI objects
This version of JointAI contains some major changes. To extend the package it was necessary to change the internal structure and it was not possible to assure backward compatibility.
It is now possible to fit hierarchical models with more than one level of grouping, with nested as well as crossed random effects (check the help file) of the main model function for details on how to specify such random effects structures.
This does also apply to survival models, i.e., it is possible to specify a random effects structure to model survival outcomes in data with a hierarchical structure, e.g., in a multi-centre setting.
coxph_imp() can now handle time-dependent covariates using last-observation-carried-forward. This requires to add
(1 | <id variable>) to the model formula to identify which rows belong to the same subject, and to specify the argument
timevar to identify the variable that contains the observation time of the longitudinal measurements.
By providing a list of model formulas it is possible to fit multiple analysis models (of different types) simultaneously. The models can share covariates and it is possible to have the response of one model as covariate in another model (in a sequential manner, however, not circular).
As before, proportional odds are assumed by default for all covariates of a cumulative logit model. The argument
nonprop accepts a one-sided formula or a named list of one-sided formulas in which the covariates are specified for which non-proportional odds should be assumed.
Additionally, the argument
rev is available to specify a vector of names of ordinal responses for which the odds should be inverted. For details, see the the help file.
glmer_imp()are aliases for
random) as well as using specification as in lme4 (with a combined model formula for fixed and random effects).
JM_imp()allows setting the number of degrees of freedom in the B-spline basis used to model the baseline hazard.
options("contrasts")is no longer ignored. For completely observed covariates, any of the contrasts available in base R are possible and
options("contrasts")is used to determine which contrasts to use. For covariates with missing values, effect coding (
contr.sum) and dummy coding (
contr.treatment) are possible. This means that for completely observed ordered factors the default is
contr.poly, but for incomplete ordered factors the default is
summary(), the argument
multivariateto the function
GR_crit()is now set to
FALSEto avoid issues. The multivariate version can still be obtained by using
JM_imp()are monitored automatically when “analysis_main = TRUE”.
get_models()is no longer exported because it now requires more input variables and is no longer convenient to use. To obtain the default specification of the model types use one of the main functions (
n.adapt = 0(and
n.iter = 0), and obtain the model types as
list_models()now returns information on all sub-models, including the main analysis models (previously it included only information on covariates).
parameters()has changed. The function returns a list of matrices, one per analysis model, with information on the response variable, response category, name of the regression coefficient and its associated covariate.
missinfo = TRUEin
summar()adds information on the missing values in the data involved in a JointAI model (number and proportion of complete cases, number and proportion of missing values per variable).
ridgehas changed to
shrinkage = "ridge", a ridge prior is used for all regression coefficients in all sub-models. If a vector of response variable names is provided to
shinkage, ridge priors are only used for the coefficients in these models.
default_hyperpars(): The default hyper-parameters for random effects are no longer provided as a function but more consistently with the hyper-parameters for other model parts, as a vector (within the list of all hyper-parameters).
default_hyperpars(): the default number of degrees of freedom in the Wishart distribution used for the inverse of the random effects covariance matrix is now the number of random effects + 1 (was the number of random effects before).
seedin JointAI is now only local, i.e., in functions in which
set.seed()is called, the random number generator state
.Random.seedbefore setting the seed is recorded, and re-set to that value on exiting the function.
varhas changed to
varsand expects a formula. This extends the functionality of
predDF()to let multiple variables vary.
JointAIobject have changed. Potentially relevant for users:
JointAIobjects now contain information on the computational time and environment they were run in: the element
comp_infocontains the time-stamp the model was fitted, the duration of the computation, the JointAI version number and the R session info.
messnow also affect the output of rjags.
future::plan()for how the “future” should be handled. As a consequence, the arguments
n.coresare no longer used. Information on the setting that was used with regards to parallel computation is returned in a
add_samples()when used in parallel with thinning fixed
predict()can now handle
newdatawith missing outcome values; predicted values for cases with missing covariates are
NA(prediction with incomplete covariates is planned to be implemented in the future)
plot_imp_distr()when only one variable has missing values
ncoreshas changed to
n.coresfor consistency with
coxph_imp()does no longer use a counting process implementation but uses the likelihood in JAGS directly via the zeros trick
predict()now has an argument
lengthto change number of evaluation points
MC_error()now have an argument
exclude_chainsthat allows to specify chains that should be omitted
citation()now refers to a manuscript on arXiv
glmm_lognormavailable to impute level-1 covariates with a log-normal mixed model
plot()available for (some of the) main analysis types (details see documentation)
get_models()so that the user can specify to also include models for complete covariates (which are then positioned in the sequence of models according to the systematic used in JointAI). Specification of a model not needed for imputation prints a notification.
JointAIobjects (most types) now also include residuals and fitted values (so far, only using fixed effects)
Xlis no longer included in
data_listwhen it is not used in the model
subsetwhen specified as vector
summary: range of iterations is printed correctly now when argument
autoburnin = FALSEunless specified otherwise via
initsis specified as a function, the function is evaluated and the resulting list passed to JAGS (previously the function was passed to JAGS)
simWidehave changed (more variables, less subjects)
imp_pars = TRUE(when user specified via
survreg_impthe sign of the regression coefficient is now opposite to match the one from
add_samples(): bug that copied the last chain to all other chains fixed
Xc, so that specification of functions of covariates in auxiliary variables works better
densplot()issue (all plots showed all lines) fixed
traceplot()limit the number of plots on one page to 64 when rows and columns of the layout are not user specified (to avoid the ‘figure margins too large’ error)
longDFexample data: new version containing complete and incomplete categorical longitudinal variables (and variable names L1 and L2 changed to c1 and c2)
list_impmodels()is kept as an alias for now)
clmm_imp(): new functions for analysis of ordinal (mixed) models
coxph_imp(): new function to fit Cox proportional hazards models with incomplete (baseline) covariates
no_modelallows to specify names of completely observed variables for which no model should be specified (e.g., “time” in a mixed model)
ridge = TRUEallows to use shrinkage priors on the precision of the regression coefficients in the analysis model
plot_all()can now handle variables from classes
parallelallows different MCMC chains to be sampled in parallel
ncoresallows to specify the maximum number of cores to be used
seedadded for reproducible results; also a sampler (
.RNG.name) and seed value for the sampler (
.RNG.seed) are set or added to user-provided initial values (necessary for parallel sampling and reproducibility of results)
plot_imp_distr(): new function to plot distribution of observed and imputed values
RinvDis no longer selected to be monitored in random intercept model (
RinvDis not used in such a model)
summary(): reduced default number of digits
methnow uses default values if only specified for subset of incomplete variables
minspaceadded to ensure spacing of iterations selected as imputations
densplot(): accepts additional options, e.g.,
list_models()replaces the function
list_impmodels()(which is now an alias)
coef()method added for
confint()method added for
print()method added for
survreg_imp()added to perform analysis of parametric (Weibull) survival models
glme_imp()added to perform generalized linear mixed modelling
contrast.argthat now in some cases cause error
|# JointAI 0.3.2|
|# JointAI 0.3.1|
|## Bug fixes *
|## Minor changes *
monitor_paramsis now checked to avoid problems when only part of the main parameters is selected
md.pattern()now uses ggplot, which scales better than the previous version
lme_imp()now ask about overwriting a model file
analysis_main = Tstays selected when other parameters are followed as well
includeadded to select if original data are included and id variable
.idis added to the dataset
subsetargument uses same logit as
lme_imp()now take argument
truncin order to truncate the distribution of incomplete variables
summary()now omits auxiliary variables from the output
imp_par_listis now returned from JointAI models
cat_varsis no longer returned from
lme_imp(), because it is contained in
traceplot()optional with ggplot
densplot()option to combine chains before plotting
list_impmodelsto print information on the imputation models and hyper-parameters
parameters()added to display the parameters to be/that were monitored
set_refcat()added to guide specification of reference categories
md_pattern(): does not generate duplicate plot any more
get_MIdat(): imputed values are now filled in in the correct order
get_MIdat(): variables imputed with
lognormare now included when extracting an imputed dataset
get_MIdat(): imputed values of transformed variables are now included in imputed datasets
md.pattern(): adaptation to new version of
md.pattern()from the mice package