response.BTLLasso {BTLLasso}R Documentation

Create response object for BTLLasso

Description

Create a response object for BTLLasso and cv.BTLLasso

Usage

response.BTLLasso(
  response,
  first.object = NULL,
  second.object = NULL,
  subject = NULL,
  with.order = rep(TRUE, length(response))
)

Arguments

response

Vector containing results (binary or ordinal) of single paired comparisons. Alternatively, also a paircomp object as defined in the package psychotools could be used. In this case, none of the further arguments are needed.

first.object

Vector (character or factor, same length as response) indicating the first object of the respective paired comparison from response.

second.object

Vector (character or factor, same length as response) indicating the second object of the respective paired comparison from response.

subject

Vector (character, same length as response) indicating the subject that generated the respective paired comparison from response.

with.order

Boolean vector containing indicators for each paired comparison if an order effect was present. By default, an order effect is assumed for each comparison. This option is relevant whenever only some of the paired comparisons had an order effect and others did not, for example if some matches are played on neutral ground. This option is only effective if either order.effect = TRUE or object.order.effect = TRUE.

Value

Object of class response.BTLLasso

Author(s)

Gunther Schauberger
gunther.schauberger@tum.de

References

Schauberger, Gunther and Tutz, Gerhard (2019): BTLLasso - A Common Framework and Software Package for the Inclusion and Selection of Covariates in Bradley-Terry Models, Journal of Statistical Software, 88(9), 1-29, doi:10.18637/jss.v088.i09

Schauberger, Gunther and Tutz, Gerhard (2017): Subject-specific modelling of paired comparison data: A lasso-type penalty approach, Statistical Modelling, 17(3), 223 - 243

Schauberger, Gunther, Groll Andreas and Tutz, Gerhard (2018): Analysis of the importance of on-field covariates in the German Bundesliga, Journal of Applied Statistics, 45(9), 1561 - 1578

See Also

BTLLasso, cv.BTLLasso

Examples


## Not run: 
##############################
##### Example how response object for Bundesliga data Buli1516 was created
##############################

data(BuliResponse)

Y.Buli <- response.BTLLasso(response = BuliResponse$Result, 
                            first.object = BuliResponse$TeamHome,
                            second.object = BuliResponse$TeamAway,
                            subject = BuliResponse$Matchday)


##############################
##### Example to create response object from paircomp object
##############################
data("Topmodel2007", package = "psychotree")

Y.models <- response.BTLLasso(Topmodel2007$preference)
X.models <- scale(model.matrix(preference~., data = Topmodel2007)[,-1])
rownames(X.models) <- paste0("Subject",1:nrow(X.models))
colnames(X.models) <- c("Gender","Age","KnowShow","WatchShow","WatchFinal")

set.seed(5)
m.models <- cv.BTLLasso(Y = Y.models, X = X.models)

## End(Not run)

[Package BTLLasso version 0.1-13 Index]