# plot.spikeslab: Plots for Spike and Slab Analysis In spikeslab: Prediction and variable selection using spike and slab regression

## Description

Plots either the gnet solution path or the cross-validated mean-squared-error (the latter only applies when cross-validation is used).

## Usage

 ```1 2``` ```## S3 method for class 'spikeslab' plot(x, plot.type = c("path", "cv"), breaks = FALSE, ...) ```

## Arguments

 `x` An object of class `spikeslab`. `plot.type` Choosing "path" produces a plot of the gnet solution path. The choice "cv" produces the mean-squared error plot. The latter applies only to objects from a `cv.spikeslab` call. `breaks` If TRUE, then vertical lines are drawn at each break point in the gnet solution path. `...` Further arguments passed to or from other methods.

## Author(s)

Hemant Ishwaran ([email protected])

J. Sunil Rao ([email protected])

Udaya B. Kogalur ([email protected])

## References

Efron B., Hastie T., Johnstone I., and Tibshirani R. (2004). Least angle regression (with discussion). Ann. Statist., 32:407-499.

Ishwaran H. and Rao J.S. (2010). Generalized ridge regression: geometry and computational solutions when p is larger than n.

`spikeslab, cv.spikeslab`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```## Not run: #------------------------------------------------------------ # Example 1: diabetes data #------------------------------------------------------------ data(diabetesI, package = "spikeslab") obj <- spikeslab(Y ~ . , diabetesI, verbose = TRUE) plot(obj, plot.type = "path") ## End(Not run) ```

### Example output

```Loading required package: lars

randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.

spikeslab 1.1.5

Type spikeslab.news() to see new features, changes, and bug fixes.

pre-processing data...
running spike and slab regression...

50 : 0.24061

100 : 0.2341

150 : 0.20017

200 : 0.21873

250 : 0.25119

300 : 0.13974

350 : 0.12523

400 : 0.2036

450 : 0.13918

500 : 0.18273

50 : 0.19749

100 : 0.19352

150 : 0.18651

200 : 0.26707

250 : 0.19609

300 : 0.14958

350 : 0.08339

400 : 0.32133

450 : 0.18844

500 : 0.13074
primary loop completed...
generalized elastic net (gnet) variable selection...
-------------------------------------------------------------------
Variable selection method     : AIC
Big p small n                 : FALSE
Screen variables              : FALSE
Fast processing               : TRUE
Sample size                   : 442
No. predictors                : 64
No. burn-in values            : 500
No. sampled values            : 500
Estimated mse                 : 2829.238
Model size                    : 15

---> Top variables:
bma   gnet bma.scale gnet.scale
bmi      24.256 24.270   509.945    510.244
ltg      22.873 22.505   480.873    473.132
map      14.317 12.769   300.997    268.462
hdl     -11.485 -9.887  -241.462   -207.866
sex      -9.131 -6.749  -191.973   -141.890
age.sex   6.052  5.682   127.227    119.454
bmi.map   4.465  4.700    93.871     98.819
glu.2     2.278  3.460    47.887     72.743
age.ltg   1.098  0.777    23.088     16.335
sex.map   1.023  0.474    21.512      9.957
age.2     0.949  0.806    19.955     16.938
age.glu   0.728  0.498    15.303     10.479
glu       0.639  0.683    13.432     14.351
bmi.2     0.607  1.135    12.767     23.863
age.map   0.538  0.807    11.306     16.966
-------------------------------------------------------------------
```

spikeslab documentation built on May 30, 2017, 6:36 a.m.