Learn R Programming

SplitWise R Package

SplitWise is a hybrid stepwise regression package that intelligently transforms numeric predictors using single- or double-split dummy encoding. Each variable can be retained as a continuous feature or transformed into binary indicators based on model fit, evaluated using AIC or BIC.

By default, SplitWise uses an iterative transformation mode, which evaluates each variable in the context of others—enabling more accurate and interpretable models by capturing feature synergies. For faster execution on large datasets, a simpler univariate mode is also available, which transforms each variable independently. While computationally efficient, this mode may miss interactions captured by the iterative approach.

Installation

To install from GitHub:

# if not already installed:
install.packages("devtools")
devtools::install_github("mtkurbucz/SplitWise")

Usage

library(SplitWise)
data(mtcars)

# Univariate transformation (backward selection using AIC)
model_uni <- splitwise(
  mpg ~ .,
  data = mtcars,
  transformation_mode = "univariate",
  direction = "backward",
  criterion = "AIC",
  trace = 0
)
summary(model_uni)

# Iterative transformation (forward selection using BIC)
model_iter <- splitwise(
  mpg ~ .,
  data = mtcars,
  transformation_mode = "iterative",
  direction = "forward",
  criterion = "BIC",
  k = log(nrow(mtcars)), # BIC penalty
  trace = 0
)
print(model_iter)

Further Documentation

Further documentation is available in the doc/ folder on GitHub.

Citation

If you use SplitWise in your research, please cite:

License

This package is licensed under the GPL-3 License.

Copy Link

Version

Install

install.packages('SplitWise')

Monthly Downloads

116

Version

1.0.2

License

GPL (>= 3)

Maintainer

Marcell T. Kurbucz

Last Published

July 31st, 2025

Functions in SplitWise (1.0.2)

splitwise

SplitWise Regression
decide_variable_type_univariate

Decide Variable Type (Univariate)
transform_features_univariate

Transform Features (Univariate Logic)
transform_features_iterative

Transform Features (Iterative Logic)
decide_variable_type_iterative

Decide Variable Type (Iterative)