Description Usage Arguments Value Author(s) See Also Examples
View source: R/predict.dglars.R
predict.dglars
is used to obtain general predictions from a dglars
object.
1 2 3 4 
object 
fitted 
xnew 
matrix of new values of the predictors at which predictions are to be made. This argument is not used for 
ynew 
vector of new values of the responce variable. This argument is used only when 
g 
value(s) of the tuning parameter g at which the predictions are required. By default, the predictions are made using the sequence of g values storaged in 
type 
type of prediction required; see below for more details. 
... 
additional argument used to ensure the compatibility with the generic method function “ 
The object returned by predict.dglars
depends on type
argument:

a named list with components “ 

the number of nonzero estimates; 

a named list; each component is a vector containing the indices of the variables that are in the active set; 

a matrix with the linear preditors. If 

a matrix with the fitted expeted values, obtained by transforming the linear predictor by the inverse of the link function. For models with ‘binomial’ family, canonical link function (‘ 

available only for ‘ 

available only for ‘ 

a vector with the scaled residual deviances. 
Luigi Augugliaro
Maintainer: Luigi Augugliaro [email protected]
dglars
and coef.dglars
.
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  ######################
# Logistic regression model
set.seed(123)
n < 100
p < 10
X < matrix(rnorm(n * p), n, p)
Xnew < matrix(rnorm(n * p), n, p)
b < 1:2
eta < b[1] + X[, 1] * b[2]
mu < binomial()$linkinv(eta)
y < rbinom(n, 1, mu)
fit < dglars.fit(X, y, binomial)
coef(fit)
predict(fit, type = "coefficients")
g < seq(3, 1, by = 0.1)
coef(fit, g = g)
predict(fit, type = "coefficients", g = g)
predict(fit, type = "nnonzero")
predict(fit, type = "nnonzero", g = g)
predict(fit, type = "predictors")
predict(fit, type = "predictors", g = g)
predict(fit, type = "eta", g = g)
predict(fit, type = "eta", g = g, xnew = Xnew)
predict(fit, type = "mu", g = g)
predict(fit, type = "mu", g = g, xnew = Xnew)
predict(fit, type = "probability", g = g)
predict(fit, type = "probability", g = g, xnew = Xnew)
predict(fit, type = "class", g = g)
predict(fit, type = "class", g = g, xnew = Xnew)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.