betaboost: Function for boosting beta regression

Description Usage Arguments Details Value References See Also Examples

Description

Wrapper function to use mode-based boosting via mboost or gamboostLSS to fit beta regression.

Usage

1
2
3
4
5
6
 betaboost(formula = NULL, phi.formula = NULL, data = list(), sl = 0.01,
           iterations = 100, form.type = c("classic", "betaboost"),
           start.mu = NULL, start.phi = NULL, 
           stabilization = c("none", "MAD", "L2"), 
           y = NULL, x = NULL, mat.parameter = c("mean", "both"), 
           mat.effect = c("linear", "smooth"),    ...)

Arguments

formula

description of the model to be fit for location parameter (mu).

phi.formula

description of the model to be fit for precision parameter (phi).

data

a data frame containing the variables.

iterations

number of boosting iterations to be used.

sl

step-length, default is 0.01

form.type

formula type: either gamboost (y ~ bols(x1) + bbs(x2)) using the mboost interface for specifying base-learners, or classic (y ~ x1 + s(x2)).

start.mu

offset value for mu, must be > 0 and < 1; will be estimated from the outcome if none is specified (default).

start.phi

offset value for phi, must be > 0; will be estimated from the outcome if none is specified (default).

stabilization

governs if the negative gradient should be standardized in each boosting step. It can be either "none", "MAD" or "L2". Only applicable when besides mu also phi is modeled (extended beta regression).

y

response vector when no formula is specified.

x

matrix of explanatory variables when no formula is specfied, per default they are included as linear effects: can be changed to smooth via mat.effects.

mat.effect

controls what type of effect the entries in matrix x have on the response. It can be either linear or smooth, while linear is the default. Only applicable if no formula is provided, but y and x.

mat.parameter

controls for which parameters the entries in matrix x are included. It can be either mean (classical beta regression) or both (extended beta regression), while mean is the default. Only applicable if no formula is provided, but y and x.

...

Additional arguments passed to mboost or gamboostLSS fitting functions.

Details

A wrapper function to fit beta regression via different boosting functions.

Value

A boosting object.

References

Mayr A, Weinhold L, Hofner B, Titze S, Gefeller O, Schmid M (2018). The betaboost package - a software tool for modeling bounded outcome variables in potentially high-dimensional data. International Journal of Epidemiology, doi: 10.1093/ije/dyy093.

Schmid M, Wickler F, Maloney KO, Mitchell R, Fenske N, & Mayr A. (2013). Boosted beta regression. PLoS ONE, 8(4), e61623.

See Also

The original function gamboostLSS and gamboost from the model-based boosting framework.

Examples

 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
#---------- data example 

data(QoLdata)

## Model for mu  
b1 <- betaboost(formula = QoL ~ arm + pain, data = QoLdata, 
                iterations = 500)

# Coeficients
coef(b1, off2int = TRUE)

# Phi
nuisance(b1)

## Model for mu and phi
b2 <- betaboost(formula = QoL ~ arm + pain, data = QoLdata, 
                iterations = 1000,
                phi.formula = QoL ~ arm + pain)


# Coeficients
coef(b2, off2int = TRUE)

#--------- simple simulated example

require(gamlss.dist)
set.seed(1234)
x1 <- rnorm(100)
x2 <- rnorm(100)
x3 <- rnorm(100)
x4 <- rnorm(100)
y <- rBE(n = 100, mu = plogis(x1 + x2),
                  sigma = plogis(x3 + x4))
data <- data.frame(y ,x1, x2, x3, x4)
data <- data[!data$y %in% c(0,1),]

# 'classic' beta regression
b3 <- betaboost(formula = y ~ x1 + x2, data = data,
                iterations = 120)
coef(b3)

# beta regression including modeled precision parameter
b4 <- betaboost(formula = y ~ x1 + x2, 
                phi.formula = y ~ x3 + x4, 
                data = data, iterations = 120)


# with smooth effects for x1 and x3
b5 <- betaboost(formula = y ~ s(x1) + x2, 
                phi.formula = y ~ s(x3) + x4, form.type = "classic",
                data = data, iterations = 120)          


# using matrix interface
b6 <- betaboost(y = data$y, x = data[,2:5], iterations = 200, 
                mat.parameter = "both")          

betaboost documentation built on May 2, 2019, 7:28 a.m.