crosscorr(), crosscorr_plot(), autocorr() and autocorr_plot()
to assess cross-correlation and autocorrelation of MCMC samples.all_vars(): update of the function; can now handle an unspecified number of
input objects and can extract variable names from formulas and character
strings that are valid variable namesdata argument are now converted with
as.data.frame(), making it possible to provide a tibbleappend_data_list argument will now
overwrite existing elements of the data_list with the same name. This
enables a wider range of changes to the automatically generated JAGS model.summary() printout showing the wrong MCMC settings when using thinning.rd_vcov(): fixed issue resulting in error when extracting random effects
variance-covariance matrix from fitted model in case of a multivariate mixed
model.(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 warn.outside.md_pattern() has an additional argument sort_columns to provide the option
to switch off the sorting of columns by number of missing values.sum_duration(): new function to get sum of computational time across chains,
phases, runs, ...formula() now also return the model formula when add_samples() is used.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 modelsadd_samples() will now result in the call element of a JointAI
object being a list and no longer a nested list.comp_info element of fitted JointAI object 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 correctlyprint.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 M_* from data_list if ncol == 0data_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 themadd_samples(): remove unnecessary call to doFuture::registerDoFuture()predDF() bug fix: the parameter for all methods is now called objectlist_models() now also works for errored JointAI objectsThis 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.
betareg_imp(): beta regressionbetamm_imp(): beta mixed modellognorm_imp(): log-normal regression modellognormmm_imp(): log-normal mixed modelmlogit_imp(): multinomial logit modelmlogitmm_imp(): multinomial mixed modelJM_imp(): joint model for longitudinal and survival dataIt 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.
lmer_imp() and glmer_imp() are aliases for lme_imp()
and glme_imp().fixed and random) as well as using specification as in lme4
(with a combined model formula for fixed and random effects).df_basehaz in coxph_imp() and 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
contr.treatment.summary(), the argument multivariate to the function GR_crit() is
now set to FALSE to avoid issues. The multivariate version can still be
obtained by using GR_crit() directly.coxph_imp() and 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 (*_imp()),
set n.adapt = 0 (and n.iter = 0), and obtain the model types as
<mymodel>$models.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 = TRUE in 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).ridge has changed to shrinkage. If 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).seed in JointAI is now only local, i.e., in
functions in which set.seed() is called, the random number generator state
.Random.seed before setting the seed is recorded, and re-set to that value
on exiting the function.predDF() the argument var has changed to vars and expects a
formula. This extends the functionality of predDF() to let multiple
variables vary.JointAI object have changed. Potentially relevant
for users:
JointAI objects now contain information on the computational time and
environment they were run in: the element comp_info contains the
time-stamp the model was fitted, the duration of the computation, the
JointAI version number and the R session info.jagsmodel.warn and mess now also affect the output of rjags.future::plan() for how the "future" should be handled. As a consequence,
the arguments parallel and n.cores are no longer used. Information on the
setting that was used with regards to parallel computation is returned in a
JointAI object via comp_list$future.clmm covariate model when there are
no baseline covariates in the modelnewdata for predict() that does not contain the outcome variableadd_samples(): calculation of end() of MCMC samples fixedadd_samples() when used in parallel with thinning fixedpredict() can now handle newdata with missing outcome values; predicted
values for cases with missing covariates are NA (prediction with incomplete
covariates is planned to be implemented in the future)get_MIdat() and plot_imp_distr() when only one variable has missing valuesncores has changed to n.cores for consistency with n.iter, n.chains, etc.coxph_imp() does no longer use a counting process implementation but uses the
likelihood in JAGS directly via the zeros trickpredict() now has an argument length to change number of evaluation pointssummary(), predict(), traceplot(), densplot(), GR_crit(), MC_error()
now have an argument exclude_chains that allows to specify chains that should be omittedcitation() now refers to a manuscript on arXivglmm_lognorm available to impute level-1 covariates with a log-normal mixed modelresiduals() and plot() available for (some of the) main analysis types (details see documentation)models added to 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.JointAI objects (most types) now also include residuals and fitted values (so far, only using fixed effects)print.JointAI fixedXl is no longer included in data_list when it is not used in the modelsubset when specified as vectorsummary: range of iterations is printed correctly now when argument end is usedsummary() calls GR_crit() with argument autoburnin = FALSE unless specified otherwise via ...inits is specified as a function, the function is evaluated and the resulting list passed to JAGS (previously the function was passed to JAGS)simong and simWide have changed (more variables, less subjects)imp_pars = TRUE
(when user specified via monitor_params or subset)survreg_imp the sign of the regression coefficient is now opposite to match the one from survregmeth has changed to modelsadd_samples(): bug that copied the last chain to all other chains fixedXc, so that specification of
functions of covariates in auxiliary variables works betterdensplot() issue (all plots showed all lines) fixedplot_all(), densplot(), and 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)longDF example data: new version containing complete and incomplete
categorical longitudinal variables (and variable names L1 and L2 changed to c1 and c2)list_impmodels() changed to list_models()
(but list_impmodels() is kept as an alias for now)clm_imp() and clmm_imp(): new functions for analysis of ordinal (mixed) modelscoxph_imp(): new function to fit Cox proportional hazards models with
incomplete (baseline) covariatesno_model allows to specify names of completely observed variables
for which no model should be specified (e.g., "time" in a mixed model)ridge = TRUE allows to use shrinkage priors on the
precision of the regression coefficients in the analysis modelplot_all() can now handle variables from classes Date and POSIXtparallel allows different MCMC chains to be sampled in parallelncores allows to specify the maximum number of cores to be usedseed added 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 valuesRinvD is no longer selected to be monitored in random intercept model (RinvD is not used in such a model)summary(): reduced default number of digitsmeth now uses default values if only specified for subset of incomplete variablesget_MIdat(): argument minspace added to ensure spacing of iterations selected as imputationsdensplot(): accepts additional options, e.g., lwd, col, ...list_models() replaces the function list_impmodels() (which is now an alias)coef() method added for JointAI object and summary.JointAI objectconfint() method added for JointAI objectprint() method added for JointAI objectsurvreg_imp() added to perform analysis of parametric (Weibull) survival modelsglme_imp() added to perform generalized linear mixed modellingtraceplot(), densplot(): specification of nrow AND ncol possible;
fixed bug when only nrow specifiedcontrast.arg that now in some cases cause errorlme_imp(): fixed error in JAGS model when interaction between random slope
variable and longitudinal variableplot_all() uses correct level-2 %NA in titlesimWide: case with no observed bmi values removedtraceplot(), densplot(): ncol and nrow now work with use_ggplot = TRUEtraceplot(), densplot(): error in specification of nrow fixeddensplot(): use of color fixedsubset now return random effects covariance matrix correctlysummary() displays output with row name when only one node is returned and
fixed display of D matrixGR_crit(): Literature reference correctedpredict(): prediction with varying factor fixedplot_all() uses xpd = TRUE when printing text for character variableslist_impmodels() uses line break when output of predictor variables exceeds
getOption("width")summary() now displays tail-probabilities for off-diagonal elements of Dpredict(): now also returns newdata extended with predictionmonitor_params is now checked to avoid problems when only part of the main
parameters is selectedmd.pattern() now uses ggplot, which scales better than the previous versionlm_imp(), glm_imp() and lme_imp() now ask about overwriting a model fileanalysis_main = T stays selected when other parameters are followed as wellget_MIdat(): argument include added to select if original data are included
and id variable .id is added to the datasetsubset argument uses same logit as monitor_params argumentlm_imp(), glm_imp() and lme_imp() now take argument trunc in order
to truncate the distribution of incomplete variablessummary() now omits auxiliary variables from the outputimp_par_list is now returned from JointAI modelscat_vars is no longer returned from lm_imp(), glm_imp() and lme_imp(),
because it is contained in Mlist$refsplot_all() function addeddensplot() and traceplot() optional with ggplotdensplot() option to combine chains before plottingNHANES, simLong and simWide addedlist_impmodels to print information on the imputation models and hyper-parametersparameters() added to display the parameters to be/that were monitoredset_refcat() added to guide specification of reference categoriesmd_pattern(): does not generate duplicate plot any moreget_MIdat(): imputed values are now filled in in the correct orderget_MIdat(): variables imputed with lognorm are now included when extracting an imputed datasetget_MIdat(): imputed values of transformed variables are now included in imputed datasetsmeth argumentmd.pattern(): adaptation to new version of md.pattern() from the mice packageNaN to NAgamma and beta imputation methods implemented