# Version 3.1.1

## Bug Fixes

* The output dataset list from %nci_multivar_mcmc() no longer lists MCMC and post-MCMC U matrix datasets when U matrices are not requested.


# Version 3.1.0

## New Features

* Posterior means and variances of the MCMC parameters have been added to the %nci_multivar_mcmc() output.
* %burn_and_thin() now re-calculates posterior means and variances using new iteration numbers.
* Added low-memory mode for %nci_multivar_mcmc() and %nci_multivar_distrib() that writes MCMC parameter traces and simulated intake replicates to SAS datasets at every iteration. 
  This can be toggled on by setting the 'low_memory_mode' argument to Y.
* Added a vignette demonstrating a low-memory NCI method workflow.
* Interactions among covariates are allowed by specifying for example covar1*covar2. Note that
  covar1*covar2 will only include the interaction terms, and not automatically include the
  main effect terms covar1 and covar2.
* The boxcox_survey macro has the new option lambda_alg to control the algorithm for finding the
  optimal Box-Cox transformation parameter.  
* %boxcox_survey() can now generate Q-Q plots of the original and Box-Cox scale variable vs. standard normal using the new 'do_plots' argument.
* Added SAS dataset that lists output datasets to the output of %boxcox_survey(), %nci_multivar_preprocessor(), and %nci_multivar_mcmc().
* Added optional arguments to name output datasets from %boxcox_survey() and %calculate_minimum_amount().
	* boxcox_survey():
		* outbc: Box-Cox lambda dataset
		* outlim: Suggested Winsorization limits dataset
		* outwin: Suggested Winsorization report dataset
		* outinf: Influential subjects report dataset
	* calculate_minimum_amount():
		* outname: Name of output dataset
* Added optional arguments that can copy the output from %burn_and_thin() to new MCMC model datasets instead of modifying the input.
	* outlib: SAS library to store output datasets
	* outname: Prefix of output datasets


## Bug Fixes

* Fixed issue where requesting ECDF plots from %nci_multivar_summary() would output density plots instead.


## Changes

* The following variables have been added to the %nci_multivar_mcmc() output datasets:
  * _vars:
    * num_variables: Number of variables in the model
  * _covars:
    * num_coefficients: Number of beta coefficients (including the intercept) for each variable
  * _covarsnc:
    * num_never_consumer_coefficients: Number of alpha coefficients (including the intercept) for the never-consumer model
* The character limit for 'outname' in %nci_multivar_mcmc() has been changed from 23 to 18 to accommodate the new posterior mean and variance datasets.
* The default algorithm in the find_best_lambda macro is now the new algorithm (alg=2).
* Titles and axis labels on density and ECDF plots from %nci_multivar_summary() were edited to be more descriptive and readable.
* The vignettes were updated to demonstrate new features.


# Version 3.0.3

## New Features

* Added 'cat_covariates' and 'cat_reference' arguments to %boxcox_survey() and %nci_multivar_mcmc() to automatically create binary indicators from categorical covariates.
* Added lim_ dataset containing lower and upper Winsorization thresholds to the output of %boxcox_survey() when 'do_winsorization' = 'N'.
* Improved the computation speed of %nci_multivar_distrib() for population bases with one record per subject.
* Improved the computation speed of the MCMC log-likelihood for models with more than 2 episodic variables.


## Bug Fixes

* Fixed IML module incompatibility with SAS/IML versions 14.3 and 15.1.
* Fixed %boxcox_survey() applying the winsorization thresholds from the first observation to the whole dataset instead of using the threshold from each observation when covariates are given.
* Fixed %draw_parameters() not giving correctly spaced draws when non-default values of 'draw_spacing' are given.
* Fixed log-likelihood of MCMC models containing never-consumers being calculated using the most recent value of alpha1 instead of the posterior mean.
* Fixed slow processing of %nci_multivar_distrib() on PC SAS.


## Changes

* Parameters of %nci_multivar_mcmc() have been renamed:
  * 'save_u_main' to 'save_mcmc_u'
* Output datasets from %nci_multivar_mcmc() have been renamed:
  * _u_main to _u_mcmc
* Variables in the output datasets from %nci_multivar_mcmc() have been renamed:
  * _subjects:
    * 'subject' to 'subject_id'
    * 'weight' to 'subject_weighting'
  * _iters:
    * 'num_trace' to 'num_traces'
* Changed indicator for intercepts in the _covars and _covarsnc output of %nci_multivar_mcmc() from a Y/N character variable to 1/0 numeric variable
* Changed  Y/N indicator 'saved_u_main' in the _iters output of %nci_multivar_mcmc() to 1/0 numeric indicator 'has.saved.mcmc.u'.
* Added warnings to %nci_multivar_summary() when quantiles or proportions are requested without required arguments.
* The default for 'do_proportions' in %nci_multivar_summary() has been changed to 'N' since no lower or upper thresholds are given by default.
* Added documentation to %nci_multivar_summary() to state that the name of a variable can be used as a threshold in the datasets given for 'lower_thresholds' and 'upper_thresholds'.
* The program now exits and prints a custom error message when attempting to load the source code when the SYSINCLUDEFILEDIR macro variable is not defined in the SAS environment.


# Version 3.0.2

## Bug Fixes

* Fixed IML module catalogs not being able to load on certain operating systems. 
  IML modules are now loaded into a temporary catalog when the package is loaded.


## Changes

* Added 'Requirements' section to the README file with SAS product and version requirements.


# Version 3.0.1

## New Features

* Added %boot_weights() macro to generate bootstrap replicate weight sets.
* Added default behavior to %brr_weights() and %boot_weights() when not using a base weight or post-stratification cell variable.
* Added simulated population of whole grain intakes 'sim_g_whole' as an additional included dataset.


## Bug Fixes

* Fixed cases where the %nci_multivar_mcmc() macro could generate invalid negative seeds if mcmc_seed was not specified.
* Fixed an issue where ODS output of PROC SURVEYREG in %boxcox_survey() was not suppressed with some ODS destinations.


## Changes

* Changed text of 'statistic' column in %summary_predictions() output to show the name of the 'id' variable.
* Reorganized code and explanations in vignettes to make them easier to read.
* Suppressed ODS output of regression models in regression calibration and multiple imputation vignettes.
* Changed the following names of output datasets from %nci_multivar_preprocessor():
  * _mcmc_input to _mcmc_in
* Changed the following names of output datasets from %nci_multivar_mcmc():
  * _variable_data to _vars
  * _covariates to _covars
  * _iterations to _iters
  * _mcmc_seed to _seed
  * _consumer_prob to _conprob1
  * _covariates_nc to _covarsnc
  * _likelihood to _ll
* Changed the following names of output datasets from %extract_parameters():
  * _mcmc_means to _means
  * _mcmc_cov to _cov
* Increased the character limit for the 'outname' prefix parameter in the following macros:
  * %nci_multivar_preprocessor: 20 to 23
  * %nci_multivar_mcmc: 16 to 23
  * %extract_parameters: 16 to 26
  * %draw_parameters: 16 to 21
* The output of the following macros has been changed to match 'outname' instead of using a prefix:
  * %gelman_rubin()
  * %covariate_test()
  * %nci_multivar_distrib()
* The random number generator seed used for %nci_multivar_distrib() is now output as the '_seed' column in the output dataset.


# Version 3.0.0

* Initial rewrite