This function implements Partial least squares beta regression models on complete or incomplete datasets (formula specification of the model).
PLS_beta_formula(
formula,
data = NULL,
nt = 2,
limQ2set = 0.0975,
dataPredictY = dataX,
modele = "pls",
family = NULL,
typeVC = "none",
EstimXNA = FALSE,
scaleX = TRUE,
scaleY = NULL,
pvals.expli = FALSE,
alpha.pvals.expli = 0.05,
MClassed = FALSE,
tol_Xi = 10^(-12),
weights,
subset,
start = NULL,
etastart,
mustart,
offset,
method,
control = list(),
contrasts = NULL,
sparse = FALSE,
sparseStop = TRUE,
naive = FALSE,
link = NULL,
link.phi = NULL,
type = "ML",
verbose = TRUE
)
Depends on the model that was used to fit the model.
an object of class "formula
" (or one that can
be coerced to that class): a symbolic description of the model to be fitted.
The details of model specification are given under 'Details'.
an optional data frame, list or environment (or object coercible
by as.data.frame
to a data frame) containing the variables in
the model. If not found in data
, the variables are taken from
environment(formula)
, typically the environment from which
plsRbeta
is called.
number of components to be extracted
limit value for the Q2
predictor(s) (testing) dataset
name of the PLS glm or PLS beta model to be fitted
("pls"
, "pls-glm-Gamma"
, "pls-glm-gaussian"
,
"pls-glm-inverse.gaussian"
, "pls-glm-logistic"
,
"pls-glm-poisson"
, "pls-glm-polr"
, "pls-beta"
). Use
"modele=pls-glm-family"
to enable the family
option.
a description of the error distribution and link function to
be used in the model. This can be a character string naming a family
function, a family function or the result of a call to a family function.
(See family
for details of family functions.) To use
the family option, please set modele="pls-glm-family"
. User defined
families can also be defined. See details.
type of leave one out cross validation. For back compatibility purpose.
no cross validation
no cross validation
no cross validation
no cross validation
only for modele="pls"
. Set whether the missing X
values have to be estimated.
scale the predictor(s) : must be set to TRUE for
modele="pls"
and should be for glms pls.
scale the response : Yes/No. Ignored since not always possible for glm responses.
should individual p-values be reported to tune model selection ?
level of significance for predictors when pvals.expli=TRUE
number of missclassified cases, should only be used for binary responses
minimal value for Norm2(Xi) and \(\mathrm{det}(pp' \times
pp)\) if there is any missing value in the dataX
. It
defaults to \(10^{-12}\)
an optional vector of 'prior weights' to be used in the
fitting process. Should be NULL
or a numeric vector.
an optional vector specifying a subset of observations to be used in the fitting process.
starting values for the parameters in the linear predictor.
starting values for the linear predictor.
starting values for the vector of means.
this can be used to specify an a priori known component
to be included in the linear predictor during fitting. This should be
NULL
or a numeric vector of length equal to the number of cases. One
or more offset
terms can be included in the formula instead or
as well, and if more than one is specified their sum is used. See
model.offset
.
the method to be
used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is
returned.
the method to be used in fitting
the model. The default method "glm.fit"
uses iteratively reweighted
least squares (IWLS). User-supplied fitting functions can be supplied either
as a function or a character string naming a function, with a function which
takes the same arguments as glm.fit
. If "model.frame"
, the
model frame is returned.
the method to be used in fitting the
model. The default method "glm.fit"
uses iteratively reweighted least
squares (IWLS). User-supplied fitting functions can be supplied either as a
function or a character string naming a function, with a function which
takes the same arguments as glm.fit
. If "model.frame"
, the
model frame is returned.
the method to
be used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is returned.
the method
to be used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is
returned.
the method to be used
in fitting the model. The default method "glm.fit"
uses iteratively
reweighted least squares (IWLS). User-supplied fitting functions can be
supplied either as a function or a character string naming a function, with
a function which takes the same arguments as glm.fit
. If
"model.frame"
, the model frame is returned.
the method to
be used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is
returned.
the method to be used in
fitting the model. The default method "glm.fit"
uses iteratively
reweighted least squares (IWLS). User-supplied fitting functions can be
supplied either as a function or a character string naming a function, with
a function which takes the same arguments as glm.fit
. If
"model.frame"
, the model frame is returned.
the method to
be used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is
returned.
the method to be used in
fitting the model. The default method "glm.fit"
uses iteratively
reweighted least squares (IWLS). User-supplied fitting functions can be
supplied either as a function or a character string naming a function, with
a function which takes the same arguments as glm.fit
. If
"model.frame"
, the model frame is returned.
the method to
be used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is
returned.
the method to be used in
fitting the model. The default method "glm.fit"
uses iteratively
reweighted least squares (IWLS). User-supplied fitting functions can be
supplied either as a function or a character string naming a function, with
a function which takes the same arguments as glm.fit
. If
"model.frame"
, the model frame is returned.
the method to be
used in fitting the model. The default method "glm.fit"
uses
iteratively reweighted least squares (IWLS). User-supplied fitting functions
can be supplied either as a function or a character string naming a
function, with a function which takes the same arguments as glm.fit
.
If "model.frame"
, the model frame is returned.
logistic, probit, complementary log-log or cauchit (corresponding to a Cauchy latent variable).
a list of parameters for controlling the fitting process. For
glm.fit
this is passed to glm.control
.
an optional list. See the contrasts.arg
of
model.matrix.default
.
should the coefficients of non-significant predictors
(<alpha.pvals.expli
) be set to 0
should component extraction stop when no significant
predictors (<alpha.pvals.expli
) are found
Use the naive estimates for the Degrees of Freedom in plsR?
Default is FALSE
.
character specification of the link function in the mean model
(mu). Currently, "logit
", "probit
", "cloglog
",
"cauchit
", "log
", "loglog
" are supported.
Alternatively, an object of class "link-glm
" can be supplied.
character specification of the link function in the
precision model (phi). Currently, "identity
", "log
",
"sqrt
" are supported. The default is "log
" unless
formula
is of type y~x
where the default is "identity
"
(for backward compatibility). Alternatively, an object of class
"link-glm
" can be supplied.
character specification of the type of estimator. Currently,
maximum likelihood ("ML
"), ML with bias correction ("BC
"), and
ML with bias reduction ("BR
") are supported.
should info messages be displayed ?
Frédéric Bertrand
frederic.bertrand@utt.fr
https://fbertran.github.io/homepage/
There are seven different predefined models with predefined link functions available :
ordinary pls models
glm gaussian with inverse link pls models
glm gaussian with identity link pls models
glm binomial with square inverse link pls models
glm binomial with logit link pls models
glm poisson with log link pls models
glm polr with logit link pls models
Using the "family="
option and setting
"modele=pls-glm-family"
allows changing the family and link function
the same way as for the glm
function. As a consequence
user-specified families can also be used.
accepts
the links (as names) identity
, log
and
inverse
.
accepts the links (as names)
identity
, log
and inverse
.
accepts the
links (as names) identity
, log
and inverse
.
accepts the links logit
, probit
, cauchit
,
(corresponding to logistic, normal and Cauchy CDFs respectively) log
and cloglog
(complementary log-log).
accepts
the links logit
, probit
, cauchit
, (corresponding to
logistic, normal and Cauchy CDFs respectively) log
and cloglog
(complementary log-log).
accepts the links logit
,
probit
, cauchit
, (corresponding to logistic, normal and Cauchy
CDFs respectively) log
and cloglog
(complementary log-log).
accepts the links inverse
, identity
and
log
.
accepts the links inverse
,
identity
and log
.
accepts the links
inverse
, identity
and log
.
accepts the
links log
, identity
, and
sqrt
.
accepts the links log
,
identity
, and sqrt
.
accepts the links
log
, identity
, and sqrt
.
accepts the links
1/mu^2
, inverse
, identity
and
log
.
accepts the links 1/mu^2
,
inverse
, identity
and log
.
accepts the
links 1/mu^2
, inverse
, identity
and log
.
accepts the links logit
, probit
, cloglog
,
identity
, inverse
, log
, 1/mu^2
and
sqrt
.
accepts the links logit
,
probit
, cloglog
, identity
, inverse
, log
,
1/mu^2
and sqrt
.
accepts the links
logit
, probit
, cloglog
, identity
,
inverse
, log
, 1/mu^2
and sqrt
.
can be used to create a power link function.
can be used to create a power link function.
A typical predictor has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response. A terms specification of the form first + second indicates all the terms in first together with all the terms in second with any duplicates removed.
A specification of the form first:second indicates the the set of terms obtained by taking the interactions of all terms in first with all terms in second. The specification first*second indicates the cross of first and second. This is the same as first + second + first:second.
The terms in the formula will be re-ordered so that main effects come first, followed by the interactions, all second-order, all third-order and so on: to avoid this pass a terms object as the formula.
Non-NULL weights can be used to indicate that different observations have different dispersions (with the values in weights being inversely proportional to the dispersions); or equivalently, when the elements of weights are positive integers w_i, that each response y_i is the mean of w_i unit-weight observations.
The default estimator for Degrees of Freedom is the Kramer and Sugiyama's one which only works for classical plsR models. For these models, Information criteria are computed accordingly to these estimations. Naive Degrees of Freedom and Information Criteria are also provided for comparison purposes. For more details, see Kraemer, N., Sugiyama M. (2010). "The Degrees of Freedom of Partial Least Squares Regression". preprint, http://arxiv.org/abs/1002.4112.
Frédéric Bertrand, Nicolas Meyer, Michèle Beau-Faller, Karim El Bayed, Izzie-Jacques Namer, Myriam Maumy-Bertrand (2013). Régression Bêta PLS. Journal de la Société Française de Statistique, 154(3):143-159. http://publications-sfds.math.cnrs.fr/index.php/J-SFdS/article/view/215
PLS_beta_wvc
and
PLS_beta_kfoldcv_formula
data("GasolineYield",package="betareg")
modpls <- PLS_beta_formula(yield~.,data=GasolineYield,nt=3,modele="pls-beta")
modpls$pp
modpls$Coeffs
modpls$Std.Coeffs
modpls$InfCrit
modpls$PredictY[1,]
rm("modpls")
Run the code above in your browser using DataLab