Description Usage Arguments Examples
S3 method plot
for an object of class sgpv
. When the two-stage
algorithm is used, this function plots the fully relaxed lasso solution path on
the standardized scale and the final variable selection results. When the
one-stage algorithm is used, a histogram of all coefficients with selected effects
is shown.
1 2 |
x |
An |
lpv |
Lines per variable. It can take the value of 1 meaning that only the bound that is closest to the null will be plotted, or the value of 3 meaning that point estimates as well as 95% confidence interval will be plotted. Default is 3. |
lambda.max |
The maximum lambda on the plot. Default is |
short.label |
An indicator if a short label is used for each variable for
better visualization. Default is |
... |
Other |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # prepare the data
x <- t.housing[, -ncol(t.housing)]
y <- t.housing$V9
# one-stage algorithm
out.sgpv.1 <- pro.sgpv(x = x, y = y, stage = 1)
# plot the selection result
plot(out.sgpv.1)
# two-stage algorithm
out.sgpv.2 <- pro.sgpv(x = x, y = y)
# plot the fully relaxed lasso solution path and final solution
plot(out.sgpv.2)
# zoom in a little bit
plot(out.sgpv.2, lambda.max = 0.01)
# only plot one confidence bound
plot(out.sgpv.2, lpv = 1, lambda.max = 0.01)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.