## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(AutoStrataK)

## -----------------------------------------------------------------------------
data <- data.frame(
  income = c(15, 18, 20, 25, 30, 35, 40, 50),
  expenditure = c(10, 12, 14, 18, 22, 26, 30, 38)
)

head(data)

## -----------------------------------------------------------------------------
result <- autostrata(
  data = data,
  target = income,
  n_strata = 4
)

head(result)

## -----------------------------------------------------------------------------
evaluate_strata(
  result,
  target = "income"
)

## -----------------------------------------------------------------------------
summary(result)

## -----------------------------------------------------------------------------
plot(result)

