Description Usage Arguments Details Value Author(s) References See Also Examples

Computes p-values and confidence intervals for least angle regression

1 2 |

`obj` |
Object returned by |

`sigma` |
Estimate of error standard deviation. If NULL (default), this is estimated
using the mean squared residual of the full least squares fit when n >= 2p, and
using the standard deviation of y when n < 2p. In the latter case, the user
should use |

`alpha` |
Significance level for confidence intervals (target is miscoverage alpha/2 in each tail) |

`k` |
See "type" argument below. Default is NULL, in which case k is taken to be the the number of steps computed in the least angle regression path |

`type` |
Type of analysis desired: with "active" (default), p-values and confidence intervals are computed for each predictor as it is entered into the active step, all the way through k steps; with "all", p-values and confidence intervals are computed for all variables in the active model after k steps; with "aic", the number of steps k is first estimated using a modified AIC criterion, and then the same type of analysis as in "all" is carried out for this particular value of k. Note that the AIC scheme is defined to choose a number of steps k after which the AIC criterion
increases |

`gridrange` |
Grid range for constructing confidence intervals, on the standardized scale |

`bits` |
Number of bits to be used for p-value and confidence interval calculations. Default is
NULL, in which case standard floating point calculations are performed. When not NULL,
multiple precision floating point calculations are performed with the specified number
of bits, using the R package |

`mult` |
Multiplier for the AIC-style penalty. Hence a value of 2 (default) gives AIC, whereas a value of log(n) would give BIC |

`ntimes` |
Number of steps for which AIC-style criterion has to increase before minimizing point is declared |

`verbose` |
Print out progress along the way? Default is FALSE |

This function computes selective p-values and confidence intervals (selection intervals)
for least angle regression. The default is to report the results for
each predictor after its entry into the model. See the "type" argument for other options.
The confidence interval construction involves numerical search and can be fragile:
if the observed statistic is too close to either end of the truncation interval
(vlo and vup, see references), then one or possibly both endpoints of the interval of
desired coverage cannot be computed, and default to +/- Inf. The output `tailarea`

gives the achieved Gaussian tail areas for the reported intervalsâ€”these should be close
to alpha/2, and can be used for error-checking purposes.

`type` |
Type of analysis (active, all, or aic) |

`k` |
Value of k specified in call |

`khat` |
When type is "active", this is an estimated stopping point
declared by |

`pv` |
P-values for active variables |

`ci` |
Confidence intervals |

`tailarea` |
Realized tail areas (lower and upper) for each confidence interval |

`vlo` |
Lower truncation limits for statistics |

`vup` |
Upper truncation limits for statistics |

`vmat` |
Linear contrasts that define the observed statistics |

`y` |
Vector of outcomes |

`pv.spacing` |
P-values from the spacing test (here M+ is used) |

`pv.modspac` |
P-values from the modified form of the spacing test (here M+ is replaced by the next knot) |

`pv.covtest` |
P-values from covariance test |

`vars` |
Variables in active set |

`sign` |
Signs of active coefficients |

`alpha` |
Desired coverage (alpha/2 in each tail) |

`sigma` |
Value of error standard deviation (sigma) used |

`call` |
The call to larInf |

Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid

Ryan Tibshirani, Jonathan Taylor, Richard Lockhart, and Rob Tibshirani (2014). Exact post-selection inference for sequential regression procedures. arXiv:1401.3889.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
set.seed(43)
n = 50
p = 10
sigma = 1
x = matrix(rnorm(n*p),n,p)
beta = c(3,2,rep(0,p-2))
y = x%*%beta + sigma*rnorm(n)
# run LAR
larfit = lar(x,y)
# compute sequential p-values and confidence intervals
# (sigma estimated from full model)
out.seq = larInf(larfit)
out.seq
# compute p-values and confidence intervals after AIC stopping
out.aic = larInf(larfit,type="aic")
out.aic
# compute p-values and confidence intervals after 5 fixed steps
out.fix = larInf(larfit,type="all",k=5)
out.fix
``` |

```
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16
Loading required package: intervals
Attaching package: 'intervals'
The following object is masked from 'package:Matrix':
expand
Loading required package: survival
Call:
larInf(obj = larfit)
Standard deviation of noise (specified or estimated) sigma = 1.012
Sequential testing results with alpha = 0.100
Step Var Coef Z-score P-value LowConfPt UpConfPt Spacing CovTest LowTailArea
1 1 2.606 17.395 0.000 2.358 2.853 0.000 0.000 0.049
2 2 2.048 14.174 0.000 1.809 2.286 0.000 0.000 0.049
3 7 0.183 1.246 0.592 -1.036 0.583 0.623 0.693 0.000
4 6 -0.140 -1.016 0.602 -1.346 2.401 0.602 0.848 0.050
5 9 -0.144 -0.912 0.633 -2.641 5.171 0.633 0.922 0.050
6 5 -0.135 -0.991 0.229 -3.951 0.998 0.208 0.720 0.050
7 3 0.095 0.587 0.603 -2.802 1.637 0.603 0.906 0.050
8 4 0.118 0.681 0.676 -4.446 1.785 0.444 0.824 0.050
9 8 0.050 0.300 0.633 -4.155 2.189 0.543 0.950 0.050
10 10 -0.029 -0.155 0.440 -4.480 3.460 0.558 0.976 0.050
UpTailArea
0.049
0.049
0.050
0.050
0.050
0.000
0.050
0.050
0.050
0.050
Estimated stopping point from ForwardStop rule = 2
Call:
larInf(obj = larfit, type = "aic")
Standard deviation of noise (specified or estimated) sigma = 1.012
Testing results at step = 2, with alpha = 0.100
Var Coef Z-score P-value LowConfPt UpConfPt LowTailArea UpTailArea
1 2.961 19.497 0 2.710 3.212 0.049 0.049
2 2.048 14.174 0 1.809 2.286 0.049 0.049
Estimated stopping point from AIC rule = 2
Call:
larInf(obj = larfit, k = 5, type = "all")
Standard deviation of noise (specified or estimated) sigma = 1.012
Testing results at step = 5, with alpha = 0.100
Var Coef Z-score P-value LowConfPt UpConfPt LowTailArea UpTailArea
1 2.955 18.931 0.000 2.184 3.331 0.050 0.049
2 2.060 14.238 0.000 1.820 2.298 0.049 0.050
7 0.127 0.831 0.517 -1.585 1.304 0.050 0.050
6 -0.148 -1.077 0.581 -1.368 2.229 0.050 0.050
9 -0.144 -0.912 0.633 -2.641 5.171 0.050 0.050
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.