Learn R Programming

betaboost (version 1.0.1)

R2.betaboost: Computing pseudo R^2 for betaboost models.

Description

Computes different pseudo R^2 for betaboost models

Usage

R2.betaboost(model, data, newdata = NULL)

Arguments

model

A boosting model object for beta regression.

data

Underlying data frame

newdata

test-data (optional), if omitted R^2 is computed on data (training-data)

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.

Examples

Run this code
# NOT RUN {
# 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),]
rm(x1,x2,x3,x4,y)

b1 <- betaboost(formula = y ~ x1 + x2, 
                phi.formula = y ~ x3 + x4, 
                data = data, form.type = "classic",
                iterations = 120)
R2.betaboost(b1, data = data)

# }

Run the code above in your browser using DataLab