# An Introduction to BMIselect

#### Jungang Zou

#### 2026-07-08

## Introduction

The R package BMIselect (Bayesian MI-LASSO for Variable Selection on Multiply-Imputed Datasets) provides a suite of Bayesian MI-LASSO for variable selection methods for multiply-imputed datasets. The package includes four Bayesian MI-LASSO models using shrinkage (Multi-Laplace, Horseshoe, ARD) and Spike-and-Slab (Spike-and-Laplace) priors, along with tools for model fitting via MCMC, four-step projection predictive variable selection, and hyperparameter calibration. Methods are suitable for continuous outcomes and both continuous and binary covariates under missing-at-random or missing-completely-at-random assumptions. See Zou, J., Wang, S. and Chen, Q. (2025), Bayesian MI-LASSO for Variable Selection on Multiply-Imputed Data. ArXiv, 2211.00114. doi:10.48550/arXiv.2211.00114 for more details.

This vignette introduces the workflow of the package, including simulating a multiply-imputed dataset, running variable selection methods and reporting the post-selection inference.

    library(BMIselect)
    seed = 12345
    set.seed(seed)

## Data Preparation

The functions of `sim_A()`, `sim_B()`, `sim_C()` are used to generate data based on the simulation section in the original paper. Here we use `sim_A()` to simulate a dataset of \(n=200\) samples with \(p=20\) covariates. The \(p=20\) covariates are independent standard normals. Among them, the \(1,2,5,11,12,15\)-th covariates are used to build outcome model, with coefficients are all ones. Missingness are generated based on MAR assumption. Multiple imputation is based on MICE. We generate five imputed sets.

The object from `sim_A()` is a list, containing the originally generated dataset `data_O`, the dataset imposed with missing values `data_mis`, the data with only complete cases `data_CC`, the five imputed dataset `data_MI`, the vector `important` to indicate if covariate is related to outcome or not, the covariance matrix `covmat` to generate covariates matrix, and the coefficients vector `beta`.

    # Simulate data
    data <- sim_A(
      n = 100,
      p = 20,
      type = "MAR",
      seed = seed,
      n_imp = 5
    )

    str(data, max.level = 1)
    #> List of 7
    #>  $ data_O   :List of 2
    #>  $ data_mis :List of 2
    #>  $ data_MI  :List of 2
    #>  $ data_CC  :List of 2
    #>  $ important: logi [1:20] TRUE TRUE FALSE FALSE TRUE FALSE ...
    #>  $ covmat   : num [1:20, 1:20] 1 0 0 0 0 0 0 0 0 0 ...
    #>  $ beta     : num [1:20] 1 1 0 0 1 0 0 0 0 0 ...

In this vignette, we focus on variable selection on the multiply-imputed set `data_MI`. The dataset contains a three-dimensional multiply-imputed covariates `data_MI$X` and a two-dimensional outcome matrix `data_MI$Y`. The dimensions of `data_MI$X` is \((D, n, p)\), where \(D\) is the number of imputations. Similarly, the dimension of `data_MI$Y` is \((D, n)\).

    str(data$data_MI)
    #> List of 2
    #>  $ X: num [1:5, 1:100, 1:20] 0.547 0.547 0.547 0.547 0.547 ...
    #>  $ Y: num [1:5, 1:100] -2.68 -2.68 -2.68 -2.68 -2.68 ...

## Variable Selection Using Bayesian MI-LASSO

Our `BMI_LASSO()` function performs Bayesian variable selection using a two-stage process. The function `BMI_LASSO()` automatically perform these two-stage algorithm and report the post-selection inference.

In the first stage, we use Markov Chain Monte Carlo (MCMC) to fit a Bayesian group LASSO model. You can choose from the following prior types:

- `"Multi_Laplace"`
- `"Horseshoe"`
- `"ARD"` (Automatic Relevance Determination)
- `"Spike_Laplace"`

The first three priors are called shrinkage priors, which gently push the coefficient estimates toward zero without setting them exactly to zero (similar to ridge regression). In contrast, the Spike-and-Laplace model uses a spike-and-slab prior, which combines the coefficients with hidden on/off switches to more explicitly decide whether a variable should be included or not. However, variable selection is an issue for these four priors: shrinkage models get non-zero coefficients estimates for all variables, and Spike-and-Slab prior may select different variable sets (different on/off switches) across MCMC draws. Also, the post-selection estimation is also a classical issue for variable selection. This motivates us to propose the method in the second stage.

In the second stage, we apply a four-step projection predictive variable selection method to address the limitations above:

1. Generate candidate variable subsets using different thresholds between 0 and 1 (specified by the parameter `grid`). The thresholds will be used by a scaled-neighborhood criterion (see more details in the paper). A candidate set excludes all variables when the threshold is 0, and keeping all variables when the threshold is 1.
2. Fit submodels using each candidate subset. Each submodel attempts to approximate the full model as closely as possible.
3. Evaluate each submodel using the Bayesian Information Criterion (BIC). Select the optimal submodel based on the smallest BIC value.
4. Report the post-selection estimates from the optimal submodel.

See Zou, J., Wang, S. and Chen, Q. (2025), Bayesian MI-LASSO for Variable Selection on Multiply-Imputed Data. ArXiv, 2211.00114. doi:10.48550/arXiv.2211.00114 for more details.

### Example of Horseshoe model

Here is an example using `"Horseshoe"` model. We specify 4000 iterations for both burn-in period and sampling period.

    bmilasso <- BMI_LASSO(data$data_MI$X, data$data_MI$Y, model = "Horseshoe",
                     nburn = 4000, npost = 4000, output_verbose = TRUE, seed = seed)
    #> Chain 1: 1000/8000, burn-in
    #> Chain 1: 2000/8000, burn-in
    #> Chain 1: 3000/8000, burn-in
    #> Chain 1: 4000/8000, burn-in
    #> Chain 1: 5000/8000, sampling
    #> Chain 1: 6000/8000, sampling
    #> Chain 1: 7000/8000, sampling
    #> Chain 1: 8000/8000, sampling
    #> Max per-imputation rank-normalized split-Rhat (full model) = 1.020
    #> Max per-imputation rank-normalized split-Rhat (selected model) = 1.001
    #> Running time for 1 chain: 0.05 minutes

    str(bmilasso, max.level = 1)
    #> List of 7
    #>  $ posterior             :List of 14
    #>  $ select                : logi [1:8, 1:20] FALSE TRUE TRUE TRUE TRUE TRUE ...
    #>   ..- attr(*, "dimnames")=List of 2
    #>  $ best_select           : logi [1, 1:20] TRUE TRUE FALSE FALSE TRUE FALSE ...
    #>   ..- attr(*, "dimnames")=List of 2
    #>  $ posterior_best_models :List of 8
    #>  $ bic_models            : num [1:2, 1:8] 2.52 0 1.62 28.55 1.63 ...
    #>   ..- attr(*, "dimnames")=List of 2
    #>  $ summary_table_full    : drws_smm [22 × 10] (S3: draws_summary/tbl_df/tbl/data.frame)
    #>   ..- attr(*, "num_args")= list()
    #>  $ summary_table_selected: drws_smm [22 × 10] (S3: draws_summary/tbl_df/tbl/data.frame)
    #>   ..- attr(*, "num_args")= list()

The returned object is a list, containing posterior draws, selected model, BIC for all submodels, and some summary tables. We first take a look at the three important objects: `best_select`, `posterior_best_models`, and `summary_table_selected`:

- `best_select`: a logical vector to indicate the selection from the optimal (sub)model. Its rowname is the corresponding threshold.
- `posterior_best_models`: posterior draws of coefficients (beta), intercept (alpha) and regression variance (sigma2) for the optimal (sub)model. We also include the pooled posterior draws of coefficients and intercept across imputations. If the parameter `standardize` of `BMI_LASSO()` is `TRUE`, our function will normalize each covariate and centralize outcomes within each imputed set. The model will exclude the intercept when fitting. Then `posterior_best_models` contains the posterior draws of estimates on both normalized scales and original scales.
- `summary_table_selected`: a summary table to summarize the posterior estimates for the optimal (sub)model. If the parameter `standardize` of `BMI_LASSO()` is `TRUE`, we report the estimates on original scales.

    # selection vector of optimal (sub)model
    bmilasso$best_select
    #>      [,1] [,2]  [,3]  [,4] [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12] [,13]
    #> 0.01 TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE
    #>      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
    #> 0.01 FALSE  TRUE FALSE FALSE FALSE FALSE FALSE

    # posterior draws of coefficients, intercept and regression variance for the optimal (sub)model
    str(bmilasso$posterior_best_models)
    #> List of 8
    #>  $ post_sigma2            : num [1:4000] 3.63 4.21 3.6 3.52 3.49 ...
    #>  $ post_beta              : num [1:4000, 1:5, 1:20] 1.111 1.074 1.222 1.321 0.986 ...
    #>  $ post_pool_beta         : num [1:20000, 1:20] 1.111 1.074 1.222 1.321 0.986 ...
    #>  $ post_alpha             : NULL
    #>  $ post_pool_alpha        : num(0)
    #>  $ post_beta_original     : num [1:4000, 1:5, 1:20] 1.101 1.064 1.211 1.309 0.977 ...
    #>  $ post_pool_beta_original: num [1:20000, 1:20] 1.101 1.064 1.211 1.309 0.977 ...
    #>  $ post_alpha_original    : num [1:4000, 1:5] -0.23 -0.336 -0.305 -0.257 -0.279 ...

    # the summary table of post-selection inference
    bmilasso$summary_table_selected
    #> # A tibble: 22 × 10
    #>    variable      mean median     sd    mad     q5    q95  rhat ess_bulk ess_tail
    #>    <chr>        <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl> <dbl>    <dbl>    <dbl>
    #>  1 intercept_… -0.240 -0.245 0.0738 0.0816 -0.353 -0.118  1.00    3637.    3461.
    #>  2 beta_pool[…  1.12   1.12  0.199  0.200   0.797  1.45   1.00    3694.    3441.
    #>  3 beta_pool[…  0.709  0.709 0.201  0.202   0.383  1.04   1.00    3218.    3492.
    #>  4 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  5 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  6 beta_pool[…  0.851  0.852 0.187  0.186   0.544  1.16   1.00    3487.    3651.
    #>  7 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  8 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  9 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #> 10 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #> # ℹ 12 more rows

If some researchers are interested in the collections of candidate submodels and their selection vectors/BIC, the objects `select` and `bic_models` contain the information:

- `select`: a logical matrix. Each row is a selection vector, whose rowname indicates its threshold. We only keep unique selection rows.
- `bic_models`: a matrix containing the BICs and degrees of freedom. Each column is a submodel.

    # selection matrix of all (sub)models
    bmilasso$select
    #>       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12]
    #> 0    FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    #> 0.01  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE
    #> 0.35  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE
    #> 0.75  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE
    #> 0.77  TRUE  TRUE FALSE FALSE  TRUE  TRUE FALSE  TRUE FALSE FALSE  TRUE  TRUE
    #> 0.78  TRUE  TRUE FALSE  TRUE  TRUE  TRUE FALSE  TRUE FALSE  TRUE  TRUE  TRUE
    #> 0.79  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
    #> 0.8   TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
    #>      [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20]
    #> 0    FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    #> 0.01 FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
    #> 0.35 FALSE FALSE  TRUE FALSE FALSE FALSE  TRUE FALSE
    #> 0.75 FALSE  TRUE  TRUE FALSE FALSE FALSE  TRUE FALSE
    #> 0.77 FALSE  TRUE  TRUE FALSE  TRUE  TRUE  TRUE FALSE
    #> 0.78 FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE
    #> 0.79 FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
    #> 0.8   TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE

    # BICs and degrees of freedom
    bmilasso$bic_models
    #>            0      0.01      0.35      0.75      0.77      0.78      0.79
    #> BIC 2.518341  1.624661  1.631505  1.642718  1.678766  1.702623  1.732629
    #> df  0.000000 28.547570 31.902876 33.164817 37.106808 39.526045 42.043581
    #>           0.8
    #> BIC  1.737993
    #> df  42.512904

In some cases, if users want to test the robustness of each prior, the Bayesian group LASSO model fitted from the first stage (before the projection predictive variable selection procedure) is needed. Users can access this information from objects `posterior` and `summary_table_full`. Additionally, the posterior draws of some hierarchical parameters are also included in `posterior`.

    # posterior draws of parameters of fitted full model in the first stage (before projection predictive variable selection procedure)
    str(bmilasso$posterior)
    #> List of 14
    #>  $ post_beta              : num [1:4000, 1:5, 1:20] 1.097 1.093 1.176 1.23 0.933 ...
    #>  $ post_fitted_Y          : num [1:4000, 1:5, 1:100] -2.29 -1.63 -3.58 -1.37 -2.47 ...
    #>  $ post_pool_beta         : num [1:20000, 1:20] 1.097 1.093 1.176 1.23 0.933 ...
    #>  $ post_pool_fitted_Y     : num [1:20000, 1:100] -2.29 -1.63 -3.58 -1.37 -2.47 ...
    #>  $ hat_matrix_proj        : num [1:5, 1:100, 1:100] 0.0789 0.0851 0.0861 0.081 0.1046 ...
    #>  $ post_lambda2           : num [1:4000, 1:20] 103.9 286.4 145.6 85.7 190.9 ...
    #>  $ post_kappa             : num [1:4000, 1:20] 0.525 8.548 0.433 1.146 0.683 ...
    #>  $ post_tau2              : num [1:4000] 0.00211 0.00228 0.00191 0.00246 0.00175 ...
    #>  $ post_eta               : num [1:4000] 612 2122 297 325 353 ...
    #>  $ post_alpha             : num [1:4000, 1:5] 0 0 0 0 0 0 0 0 0 0 ...
    #>  $ post_sigma2            : num [1:4000] 3.43 3.99 3.42 3.29 3.38 ...
    #>  $ post_beta_original     : num [1:4000, 1:5, 1:20] 1.088 1.083 1.166 1.22 0.925 ...
    #>  $ post_pool_beta_original: num [1:20000, 1:20] 1.088 1.083 1.166 1.22 0.925 ...
    #>  $ post_alpha_original    : num [1:4000, 1:5] -0.234 -0.451 -0.327 -0.384 -0.383 ...

    # the summary table of coefficients, intercept, and regression variance from the fitted full model
    bmilasso$summary_table_full
    #> # A tibble: 22 × 10
    #>    variable           mean    median     sd    mad      q5    q95  rhat ess_bulk
    #>    <chr>             <dbl>     <dbl>  <dbl>  <dbl>   <dbl>  <dbl> <dbl>    <dbl>
    #>  1 intercept_pool -0.269   -0.271    0.0880 0.0907 -0.412  -0.123  1.00    1903.
    #>  2 beta_pool[1]    1.09     1.09     0.203  0.203   0.756   1.42   1.00    3485.
    #>  3 beta_pool[2]    0.742    0.742    0.207  0.208   0.403   1.08   1.00    3062.
    #>  4 beta_pool[3]   -0.00588 -0.00146  0.0721 0.0382 -0.128   0.105  1.00    2642.
    #>  5 beta_pool[4]    0.0152   0.00429  0.0826 0.0475 -0.104   0.165  1.00    2842.
    #>  6 beta_pool[5]    0.883    0.883    0.189  0.189   0.572   1.20   1.00    3172.
    #>  7 beta_pool[6]    0.0296   0.0105   0.0915 0.0547 -0.0950  0.204  1.00    1264.
    #>  8 beta_pool[7]   -0.00406 -0.000968 0.0796 0.0460 -0.139   0.120  1.01    3439.
    #>  9 beta_pool[8]   -0.0283  -0.0107   0.0942 0.0584 -0.205   0.101  1.00    2024.
    #> 10 beta_pool[9]   -0.00544 -0.000912 0.0713 0.0378 -0.128   0.105  1.00    3282.
    #> # ℹ 12 more rows
    #> # ℹ 1 more variable: ess_tail <dbl>

### Hyperparameters Specification

In Bayesian MI-LASSO models, `"Multi_Laplace"` and `"Spike_Laplace"` priors have two hyperparameters, respectively:

- `"Multi_Laplace"`: `h` (shape) and `v` (scale) of Gamma hyperprior. `h` > 1, and `v` > 0. Default: `h` = 2 and `v` = (D+1)/(D * (h - 1)).
- `"Spike_Laplace"`: `a` (shape) and `b` (scale) of Gamma hyperprior. `a` > 1, and `b` > 0. Default: `a` = 2 and `b` = (D+1)/(2D * (a - 1)).

Users can specify the hyperparameters in `BMI_LASSO()`:

    # specify hyperparameters for Multi-Laplace model
    bmilasso_ML <- BMI_LASSO(data$data_MI$X, data$data_MI$Y, model = "Multi_Laplace",
                     nburn = 4000, npost = 4000, seed = seed, h = 10, v = 0.5)
    #> Chain 1: 1000/8000, burn-in
    #> Chain 1: 2000/8000, burn-in
    #> Chain 1: 3000/8000, burn-in
    #> Chain 1: 4000/8000, burn-in
    #> Chain 1: 5000/8000, sampling
    #> Chain 1: 6000/8000, sampling
    #> Chain 1: 7000/8000, sampling
    #> Chain 1: 8000/8000, sampling
    #> Max per-imputation rank-normalized split-Rhat (full model) = 1.002
    #> Max per-imputation rank-normalized split-Rhat (selected model) = 1.001
    #> Running time for 1 chain: 0.05 minutes

    # specify hyperparameters for Spike-Laplace model. To save time, we give an example without running
    # bmilasso_SL <- BMI_LASSO(data$data_MI$X, data$data_MI$Y, model = "Spike_Laplace",
    #                  nburn = 4000, npost = 4000, seed = seed, a = 10, b = 1)

Since `"Horseshoe"` and `"ARD"` priors do not require any hyperparameter tuning, we recommend users start with these two options for simplicity and stability. For `"Multi_Laplace"` and `"Spike_Laplace"`, we did a sensitivity analysis for these hyperparameters in our paper. Based on the results, we suggest avoiding very small values of `v` and `b`, as they may lead to unstable model fitting and variable selection. In practice, we recommend beginning with the default values provided in the function.

### Parallel Computing for Multiple Chains

If multiple cores are available, parallel computing can be used for multiple chains. This function is based on the R packages `doParallel` and `foreach`. Users can specify the parameter `ncores` for the number of cores when running multiple chains `nchain`.

    # run 2 chains using 2 cores in series
    start = Sys.time()
    bmilasso_series <- BMI_LASSO(data$data_MI$X, data$data_MI$Y, model = "Horseshoe",
                     nburn = 4000, npost = 4000, output_verbose = FALSE, nchains = 2, seed = seed)
    end = Sys.time()
    print(paste("The running time for two chains in series:", difftime(end, start, units = "mins"), "mins"))
    #> [1] "The running time for two chains in series: 0.0917880495389303 mins"

    # run 2 chains using 2 cores in parallel
    start = Sys.time()
    bmilasso_parallel <- BMI_LASSO(data$data_MI$X, data$data_MI$Y, model = "Horseshoe",
                     nburn = 4000, npost = 4000, output_verbose = FALSE, nchains = 2, ncores = 2, seed = seed)
    end = Sys.time()
    print(paste("The running time for two chains in parallel:", difftime(end, start, units = "mins"), "mins"))
    #> [1] "The running time for two chains in parallel: 0.075262467066447 mins"

The returned results from multiple chains are different from those of a single chain. The summary tables `summary_table_selected` and `summary_table_full` are calculated by pooling posterior draws from multiple chains. For all other output objects, results from each chain are listed separately, one by one, so users can obtain and compare the posterior estimates of each chain individually.

    # the posterior draws of optimal submodels of two chains
    str(bmilasso_parallel$posterior_best_models)
    #> List of 2
    #>  $ :List of 8
    #>   ..$ post_sigma2            : num [1:4000] 3.63 4.21 3.6 3.52 3.49 ...
    #>   ..$ post_beta              : num [1:4000, 1:5, 1:20] 1.111 1.074 1.222 1.321 0.986 ...
    #>   ..$ post_pool_beta         : num [1:20000, 1:20] 1.111 1.074 1.222 1.321 0.986 ...
    #>   ..$ post_alpha             : NULL
    #>   ..$ post_pool_alpha        : num(0)
    #>   ..$ post_beta_original     : num [1:4000, 1:5, 1:20] 1.101 1.064 1.211 1.309 0.977 ...
    #>   ..$ post_pool_beta_original: num [1:20000, 1:20] 1.101 1.064 1.211 1.309 0.977 ...
    #>   ..$ post_alpha_original    : num [1:4000, 1:5] -0.23 -0.336 -0.305 -0.257 -0.279 ...
    #>  $ :List of 8
    #>   ..$ post_sigma2            : num [1:4000] 3.87 4.06 3.91 4.08 3.88 ...
    #>   ..$ post_beta              : num [1:4000, 1:5, 1:20] 0.858 0.873 0.926 0.832 1.15 ...
    #>   ..$ post_pool_beta         : num [1:20000, 1:20] 0.858 0.873 0.926 0.832 1.15 ...
    #>   ..$ post_alpha             : NULL
    #>   ..$ post_pool_alpha        : num(0)
    #>   ..$ post_beta_original     : num [1:4000, 1:5, 1:20] 0.851 0.866 0.917 0.825 1.14 ...
    #>   ..$ post_pool_beta_original: num [1:20000, 1:20] 0.851 0.866 0.917 0.825 1.14 ...
    #>   ..$ post_alpha_original    : num [1:4000, 1:5] -0.228 -0.189 -0.297 -0.293 -0.253 ...

    # summary table by pooling two chains
    bmilasso_parallel$summary_table_selected
    #> # A tibble: 22 × 10
    #>    variable      mean median     sd    mad     q5    q95  rhat ess_bulk ess_tail
    #>    <chr>        <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl> <dbl>    <dbl>    <dbl>
    #>  1 intercept_… -0.240 -0.245 0.0737 0.0815 -0.354 -0.117  1.00    7175.    7086.
    #>  2 beta_pool[…  1.12   1.12  0.198  0.197   0.797  1.45   1.00    7515.    7052.
    #>  3 beta_pool[…  0.710  0.709 0.202  0.203   0.380  1.04   1.00    6839.    7402.
    #>  4 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  5 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  6 beta_pool[…  0.851  0.851 0.186  0.187   0.544  1.16   1.00    7103.    7463.
    #>  7 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  8 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #>  9 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #> 10 beta_pool[…  0      0     0      0       0      0     NA         NA       NA
    #> # ℹ 12 more rows

## Frequentists MI-LASSO

Although Bayesian MI-LASSO models have better performance than MI-LASSO, some users may be interested in frequentists method. We also include the MI-LASSO method in the function `MI_LASSO()`, originally from https://www.columbia.edu/~qc2138/Downloads/software/MI-lasso.R. We further add a parameter `ncores` to allow parallel computing. We give a brief example and more details can be found in Chen, Q. and Wang, S. (2013). “Variable selection for multiply-imputed data with application to dioxin exposure study.” Statistics in Medicine, 32(21): 3646–3659.

    # fit MI-LASSO
    milasso = MI_LASSO(data$data_MI$X, data$data_MI$Y, ncores = 2)
    #> Running time for 2 ncore: 0.04 minutes

    str(milasso)
    #> List of 2
    #>  $ best       :List of 4
    #>   ..$ coefficients: num [1:21, 1:5] -0.309 0.9 0.605 0 0 ...
    #>   ..$ bic         : num 1.64
    #>   ..$ varsel      : logi [1:20] TRUE TRUE FALSE FALSE TRUE FALSE ...
    #>   ..$ lambda      : num 4.29
    #>  $ lambda_path: num [1:101, 1:2] 0.125 0.134 0.144 0.154 0.165 ...
    #>   ..- attr(*, "dimnames")=List of 2
    #>   .. ..$ : NULL
    #>   .. ..$ : chr [1:2] "lamvec" ""

## Discussion

Here are some discussions about this package:

1. Currently, our package only supports continuous outcomes. Binary, categorical and ordinal outcomes are our research topic in the future.
2. We support continuous and binary covariates. Selection for categorical covariates is tricky. Generally we transform a categorical variable into a set of binary dummy variables. Our package supports the selection on each dummy variable. For selection of the whole group, we will research it in the future.
3. Similarly to other variable selection methods, our models are sensitive to multicollinearity. If some covariates are highly correlated, we suggest to do some pre-processing before using our methods.

## Disclaimer

If you find any bug in this package, please contact me: jungang.zou@gmail.com.