File: summary.vsel.Rd

package info (click to toggle)
r-cran-projpred 2.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 740 kB
  • sloc: cpp: 355; sh: 14; makefile: 2
file content (79 lines) | stat: -rw-r--r-- 2,573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{summary.vsel}
\alias{summary.vsel}
\title{Summary statistics related to variable selection}
\usage{
\method{summary}{vsel}(
  object,
  nterms_max = NULL,
  stats = "elpd",
  type = c("mean", "se"),
  deltas = FALSE,
  alpha = 0.32,
  baseline = NULL,
  ...
)
}
\arguments{
\item{object}{The object returned by \link[=varsel]{varsel} or
\link[=cv_varsel]{cv_varsel}.}

\item{nterms_max}{Maximum submodel size for which the statistics are
calculated. For \code{plot.vsel} it must be at least 1.}

\item{stats}{One or several strings determining which statistics to
  calculate. Available statistics are:
\itemize{
 \item{elpd:} {(Expected) sum of log predictive densities}
 \item{mlpd:} {Mean log predictive density, that is, elpd divided by the
  number of datapoints.} \item{mse:} {Mean squared error (gaussian family
  only)}
 \item{rmse:} {Root mean squared error (gaussian family only)}
 \item{acc/pctcorr:} {Classification accuracy (binomial family only)}
 \item{auc:} {Area under the ROC curve (binomial family only)}
}
Default is \code{"elpd"}.}

\item{type}{One or more items from 'mean', 'se', 'lower' and 'upper'
indicating which of these to compute (mean, standard error, and lower and
upper credible bounds). The credible bounds are determined so that
\code{1-alpha} percent of the mass falls between them.}

\item{deltas}{If \code{TRUE}, the submodel statistics are estimated relative
to the baseline model (see argument \code{baseline}) instead of estimating
the actual values of the statistics. Defaults to \code{FALSE}.}

\item{alpha}{A number indicating the desired coverage of the credible
intervals. For example \code{alpha=0.32} corresponds to 68\% probability
mass within the intervals, that is, one standard error intervals.}

\item{baseline}{Either 'ref' or 'best' indicating whether the baseline is the
reference model or the best submodel found. Default is 'ref' when the
reference model exists, and 'best' otherwise.}

\item{...}{Currently ignored.}
}
\description{
Summary statistics related to variable selection
}
\examples{
\donttest{
if (requireNamespace('rstanarm', quietly=TRUE)) {
  ### Usage with stanreg objects
  n <- 30
  d <- 5
  x <- matrix(rnorm(n*d), nrow=n)
  y <- x[,1] + 0.5*rnorm(n)
  data <- data.frame(x,y)
  
  fit <- rstanarm::stan_glm(y ~ X1 + X2 + X3 + X4 + X5, gaussian(), data=data, chains=2, iter=500)
  vs <- cv_varsel(fit)
  plot(vs)
  
  # print out some stats
  summary(vs, stats=c('mse'), type = c('mean','se'))
}
}

}