JointAI (development version)
New features
- Added functions
crosscorr(),crosscorr_plot(),autocorr()andautocorr_plot()to assess cross-correlation and autocorrelation of MCMC samples.
Small improvements
-
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 names - objects provided to the
dataargument are now converted withas.data.frame(), making it possible to provide atibble - Elements of a list supplied to the
append_data_listargument will now overwrite existing elements of thedata_listwith the same name. This enables a wider range of changes to the automatically generated JAGS model.
Bug fixes
- Error when using the same function twice in a model formula with different number of variables (e.g., I(x^2) and I(a/b)) fixed.
- Fix in identifying the number of workers used in parallel computation with the future package.
- Fix
summary()printout showing the wrong MCMC settings when using thinning.
JointAI 1.0.6
CRAN release: 2024-04-02
- clean-up of helper functions and additional unit tests
- fix typos in argument names in helpfiles
- fix documentation syntax (CRAN NOTEs)
JointAI 1.0.5
CRAN release: 2023-04-27
(update request by CRAN)
- use a wrapper for
bs()to avoid warning in CMD check when run on older version of R wheresplines::bs()did not yet have the argumentwarn.outside.
JointAI 1.0.4
CRAN release: 2022-09-03
New features
-
md_pattern()has an additional argumentsort_columnsto 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, …
Bug fixes
-
formula()now also return the model formula whenadd_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. - Bug causing the wrong elements of the data matrix to be monitored when
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
Small improvements
- Use of
add_samples()will now result in thecallelement of aJointAIobject being alistand no longer a nested list. - Re-structuring of the JAGS model code for proportional hazards models to reduce computational time.
- change in how parallel computation is done: does not rely on doFuture and foreach any more, only package future is required.
-
comp_infoelement of fittedJointAIobject 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.
JointAI 1.0.3
CRAN release: 2021-11-28
New features
-
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).
Minor improvements and bug fixes
- Bug fix in re-scaling of random effects variance covariance matrix in multi-level models with >2 levels where some levels have only random intercept.
- Bug fix in generating the names of random effect nodes to monitor when there are multiple analysis models and some do not have random effects.
- Bug fix in
plot_all()not displaying the variable name in the message shown for character string variables. - Bug fix in
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. - Bug fix: when using a function of a variable as auxiliary this is now (again) correctly used as covariate in the linear predictor of covariate models (bug was introduced in commit 15014dcd)
JointAI 1.0.2
CRAN release: 2021-01-13
New features
-
rd_vcov(): new function added to extract the random effect variance- covariance matrices (posterior means)
Minor improvements and bug fixes
- change in the way the model formula is contained in the model call, which should make it possible to call
*_imp()functions from within another function that has the model formula as an argument. - fixed issue that resulted in an error when the data was previously attached to the search path
JointAI 1.0.1
CRAN release: 2020-11-16
Minor improvements and bug fixes
-
data_list: omit data matrixM_*fromdata_listifncol == 0 -
data_list: syntax to checking whichpos_*to include can handle the case with multiple grouping variables being on the same, lowest level; beforepos_*was excluded for only one of them - random effects: it is now possible to use different grouping levels in different sub-models (when providing a list of model formulas)
-
add_samples(): remove unnecessary call todoFuture::registerDoFuture() -
predDF()bug fix: the parameter for all methods is now calledobject -
list_models()now also works for errored JointAI objects - Bug fix for models with an interaction between a repeatedly measured variable and a random slope variable. (The term was wrongly written in the mean structure for the random effect instead of the main linear predictor.)
JointAI 1.0.0
CRAN release: 2020-08-31
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.
New features
New analysis model types
-
betareg_imp(): beta regression -
betamm_imp(): beta mixed model -
lognorm_imp(): log-normal regression model -
lognormmm_imp(): log-normal mixed model -
mlogit_imp(): multinomial logit model -
mlogitmm_imp(): multinomial mixed model -
JM_imp(): joint model for longitudinal and survival data
Hierarchical models with multiple levels of grouping
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.
Proportional hazards model with time-dependent covariates
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.
Multivariate models
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).
Partial proportional odds models for ordinal responses
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.
Other new features
- The functions
lmer_imp()andglmer_imp()are aliases forlme_imp()andglme_imp(). - All mixed models can be specified using the nlme type specification (using
fixedandrandom) as well as using specification as in lme4 (with a combined model formula for fixed and random effects). - The argument
df_basehazincoxph_imp()andJM_imp()allows setting the number of degrees of freedom in the B-spline basis used to model the baseline hazard. - The global setting
options("contrasts")is no longer ignored. For completely observed covariates, any of the contrasts available in base R are possible andoptions("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 iscontr.poly, but for incomplete ordered factors the default iscontr.treatment.
Other changes
- Within
summary(), the argumentmultivariateto the functionGR_crit()is now set toFALSEto avoid issues. The multivariate version can still be obtained by usingGR_crit()directly. - The parameters of the baseline hazard for
coxph_imp()andJM_imp()are monitored automatically when “analysis_main = TRUE”. - The function
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()), setn.adapt = 0(andn.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). - The output of
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. - The argument
missinfo = TRUEinsummar()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). - The argument
ridgehas changed toshrinkage. Ifshrinkage = "ridge", a ridge prior is used for all regression coefficients in all sub-models. If a vector of response variable names is provided toshinkage, 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). - The effect of using a
seedin JointAI is now only local, i.e., in functions in whichset.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. - In
predDF()the argumentvarhas changed tovarsand expects a formula. This extends the functionality ofpredDF()to let multiple variables vary. - Some of the elements of a
JointAIobject have changed. Potentially relevant for users:-
JointAIobjects now contain information on the computational time and environment they were run in: the elementcomp_infocontains the time-stamp the model was fitted, the duration of the computation, the JointAI version number and the R session info. - The JAGS model is stored as character string in the element
jagsmodel.
-
- The arguments
warnandmessnow also affect the output of rjags. - The doFuture package is used for parallel computation instead of doParallel. Parallel computation is specified by setting a
future::plan()for how the “future” should be handled. As a consequence, the argumentsparallelandn.coresare no longer used. Information on the setting that was used with regards to parallel computation is returned in aJointAI objectviacomp_list$future.
Bug fixes
- Scaling of continuous covariates is no longer done in the data, but in the JAGS model. This fixes the issue that previously the estimated variance parameters of continuous covariates and variance parameters of their random effects were incorrect (this issue only affected the covariate models, not the main analysis model).
JointAI 0.6.1
CRAN release: 2020-02-12
Bug fixes
- Fixed bug that messed up coefficients in
clmmcovariate model when there are no baseline covariates in the model - enable
newdataforpredict()that does not contain the outcome variable -
add_samples(): calculation ofend()of MCMC samples fixed
JointAI 0.6.0
CRAN release: 2019-08-31
Bug fixes
- bug in
add_samples()when used in parallel with thinning fixed - bug fixed that occurred when a complete longitudinal categorical variable was used in a model that did not contain any incomplete baseline variables
- bug-fix for monitoring random effects
- fixed typo in selecting parameters in Gamma models
-
predict()can now handlenewdatawith missing outcome values; predicted values for cases with missing covariates areNA(prediction with incomplete covariates is planned to be implemented in the future) - bug-fix for
get_MIdat()andplot_imp_distr()when only one variable has missing values - bug-fix for longitudinal model with interaction with random slope variable
- bug-fix for model with multiple longitudinal ordinal incomplete covariates (fixed wrong selection of columns of the design matrix of longitudinal covariates in these models)
Minor changes
- moved message about bug reports to startup
- enabled inverse link by adding max restriction
- “:” in factor labels are automatically replaced by “_”
- argument
ncoreshas changed ton.coresfor consistency withn.iter,n.chains, etc. -
coxph_imp()does no longer use a counting process implementation but uses the likelihood in JAGS directly via the zeros trick
New Features / Extensions
-
predict()now has an argumentlengthto change number of evaluation points -
summary(),predict(),traceplot(),densplot(),GR_crit(),MC_error()now have an argumentexclude_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 - methods
residuals()andplot()available for (some of the) main analysis types (details see documentation) - argument
modelsadded toget_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)
JointAI 0.5.1
CRAN release: 2019-05-07
Bug fixes
- bug in ordinal models with only completely observed variables fixed (all necessary data is not passed to JAGS)
- enable thinning when using parallel sampling
- matrix
Xlis no longer included indata_listwhen it is not used in the model - bug-fix in
subsetwhen specified as vector - bug-fix in ridge regression (gave an error message)
- bug-fix in recognition of binary factors that are coded as numeric and have missing values
- bug-fix in
summary: range of iterations is printed correctly now when argumentendis used - bug-fix: error that occurred in re-scaling when reference category was changed is solved
- bug-fix in survival models: coding of censoring variable fixed
Minor changes
-
summary()callsGR_crit()with argumentautoburnin = FALSEunless specified otherwise via... - when
initsis specified as a function, the function is evaluated and the resulting list passed to JAGS (previously the function was passed to JAGS) - the example data
simongandsimWidehave changed (more variables, less subjects) - added check if there are incomplete covariates before setting
imp_pars = TRUE(when user specified viamonitor_paramsorsubset) - in
survreg_impthe sign of the regression coefficient is now opposite to match the one fromsurvreg
JointAI 0.5.0
CRAN release: 2019-03-08
Bug fixes
-
add_samples(): bug that copied the last chain to all other chains fixed - bug-fix for the order of columns in the matrix
Xc, so that specification of functions of covariates in auxiliary variables works better - adding vertical lines to a
densplot()issue (all plots showed all lines) fixed - nested functions involving powers made possible
- typo causing issue in poisson glm and glme removed
Minor changes
-
plot_all(),densplot(), andtraceplot()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) - change in
longDFexample data: new version containing complete and incomplete categorical longitudinal variables (and variable names L1 and L2 changed to c1 and c2) - Some minor changes in notes, warnings and error messages
- The function
list_impmodels()changed tolist_models()(butlist_impmodels()is kept as an alias for now) - improved handling of functional forms of covariates (also in longitudinal covariates and random effects)
New Features / Extensions
-
clm_imp()andclmm_imp(): new functions for analysis of ordinal (mixed) models - It is now possible to impute incomplete longitudinal covariates (continuous, binary and ordered factors).
-
coxph_imp(): new function to fit Cox proportional hazards models with incomplete (baseline) covariates - Argument
no_modelallows to specify names of completely observed variables for which no model should be specified (e.g., “time” in a mixed model) -
Shrinkage: argument
ridge = TRUEallows to use shrinkage priors on the precision of the regression coefficients in the analysis model -
plot_all()can now handle variables from classesDateandPOSIXt - new argument
parallelallows different MCMC chains to be sampled in parallel - new argument
ncoresallows to specify the maximum number of cores to be used - new argument
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
JointAI 0.4.0
CRAN release: 2018-12-04
Bug fixes
-
RinvDis no longer selected to be monitored in random intercept model (RinvDis not used in such a model) - fixed various bugs for models in which only the intercept is used (no covariates)
Minor changes
-
summary(): reduced default number of digits - continuous variables with two distinct values are converted to factor
- argument
methnow uses default values if only specified for subset of incomplete variables -
get_MIdat(): argumentminspaceadded to ensure spacing of iterations selected as imputations -
densplot(): accepts additional options, e.g.,lwd,col, … -
list_models()replaces the functionlist_impmodels()(which is now an alias)
Extensions
-
coef()method added forJointAIobject andsummary.JointAIobject -
confint()method added forJointAIobject -
print()method added forJointAIobject -
survreg_imp()added to perform analysis of parametric (Weibull) survival models -
glme_imp()added to perform generalized linear mixed modelling - extended documentation; two new vignettes on MCMC parameters and functions for after the model is estimated; added messages about coding of ordinal variables
JointAI 0.3.4
Bug fixes
-
traceplot(),densplot(): specification ofnrowANDncolpossible; fixed bug when onlynrowspecified
JointAI 0.3.3
Bug fixes
- remove deprecated code specifying
contrast.argthat now in some cases cause error - fixed problem identifying non-linear functions in formula when the name of another variable contains the function name
| # JointAI 0.3.2 |
|---|
| # JointAI 0.3.1 |
## Bug fixes * plot_all() uses correct level-2 %NA in title * simWide: case with no observed bmi values removed * traceplot(), densplot(): ncol and nrow now work with use_ggplot = TRUE * traceplot(), densplot(): error in specification of nrow fixed * densplot(): use of color fixed * functions with argument subset now return random effects covariance matrix correctly * summary() displays output with row name when only one node is returned and fixed display of D matrix * GR_crit(): Literature reference corrected * predict(): prediction with varying factor fixed * no scaling for variables involved in a function to avoid problems with re-scaling |
## Minor changes * plot_all() uses xpd = TRUE when printing text for character variables * list_impmodels() uses line break when output of predictor variables exceeds getOption("width") * summary() now displays tail-probabilities for off-diagonal elements of D * added option to show/hide constant effects of auxiliary variables in plots * predict(): now also returns newdata extended with prediction |
JointAI 0.3.0
CRAN release: 2018-08-14
Bug fixes
-
monitor_paramsis now checked to avoid problems when only part of the main parameters is selected - categorical imputation models now use min-max trick to prevent probabilities outside [0, 1]
- initial value generation for logistic analysis model fixed
- bug-fix in re-ordering columns when a function is part of the linear predictor
- bug-fix in initial values for categorical covariates
- bug-fix in finding imputation method when function of variable is specified as auxiliary variable
Minor changes
-
md.pattern()now uses ggplot, which scales better than the previous version -
lm_imp(),glm_imp()andlme_imp()now ask about overwriting a model file -
analysis_main = Tstays selected when other parameters are followed as well -
get_MIdat(): argumentincludeadded to select if original data are included and id variable.idis added to the dataset -
subsetargument uses same logit asmonitor_paramsargument - added switch to hide messages; distinction between messages and warnings
-
lm_imp(),glm_imp()andlme_imp()now take argumenttruncin 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 fromlm_imp(),glm_imp()andlme_imp(), because it is contained inMlist$refs
Extensions
-
plot_all()function added -
densplot()andtraceplot()optional with ggplot -
densplot()option to combine chains before plotting - example datasets
NHANES,simLongandsimWideadded -
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 - extension of possible functions of variables in model formula to (almost all) functions that are available in JAGS
- added vignettes Minimal Example, Visualizing Incomplete Data, Parameter Selection and Model Specification
JointAI 0.2.0
CRAN release: 2018-07-05
Bug fixes
-
md_pattern(): does not generate duplicate plot any more - corrected names of imputation methods in help file
- scaling when no continuous covariates are in the model or scaling is deselected fixed
- initial value specification for coefficient for auxiliary variables fixed
-
get_MIdat(): imputed values are now filled in in the correct order -
get_MIdat(): variables imputed withlognormare now included when extracting an imputed dataset -
get_MIdat(): imputed values of transformed variables are now included in imputed datasets - problem with non valid names of factor labels fixed
- data matrix is now ordered according to order in user-specified
methargument
