Package 'BRPL'

Title: Methods for Bivariate Poverty Line Calculations
Description: Provides tools for identifying subgroups within populations based on individual response patterns to specific interventions or treatments. Designed to support researchers and clinicians in exploring heterogeneous treatment effects and developing personalized therapeutic strategies. Offers functionality for analyzing and visualizing the interplay between two variables, thereby enhancing the interpretation of social sustainability metrics. The package focuses on bivariate discriminant analysis and aims to clarify relationships between indicator variables.
Authors: Franziska Dorn [aut, cre], René-Marcel Kruse [aut], Thomas Kneib [aut]
Maintainer: Franziska Dorn <[email protected]>
License: MIT + file LICENSE
Version: 1.0.2
Built: 2026-05-20 07:52:24 UTC
Source: https://github.com/cran/BRPL

Help Index


Calculate Bivariate Quantiles

Description

Calculate Bivariate Quantiles

Usage

brpl(data, var1, var2, tau = 0.5, nalpha = 100)

Arguments

data

Input data frame (tibbles and other data.frame variants are automatically converted to data.frame)

var1

Name of first variable

var2

Name of second variable

tau

Quantile level (default: 0.5)

nalpha

Number of alpha values (default: 100)

Value

An object of class brplPlot

Examples

df_data <- data.frame(x = 1:10, y = 1:10)
result <- brpl(df_data, "x", "y")

brpl Class

Description

Base class for bivariate quantile calculations


brplPlot Class

Description

Class for plotting bivariate quantile results


Calculate Empirical Cumulative Distribution Function

Description

Calculate Empirical Cumulative Distribution Function

Usage

myecdf(data, var, min.var = 0)

Arguments

data

A data frame containing the variable

var

Character string specifying the variable name

min.var

Minimum value for the variable

Value

List containing ecdf and quantile functions


Plot Method for brplPlot Class

Description

This method defines the plotting behavior for objects of the class brplPlot. It generates a scatter plot visualizing the relationship between two variables (var1 and var2) along with classification indicators and an additional line for further insights.

Usage

## S4 method for signature 'brplPlot'
plot(x, y, ...)

Arguments

x

An object of class brplPlot. The object must include the following slots:

  • ⁠@data⁠: A data frame containing the data to be plotted, including var1, var2, and a classification indicator indicator.

  • ⁠@var1⁠: A string specifying the name of the first variable to be plotted (X-axis).

  • ⁠@var2⁠: A string specifying the name of the second variable to be plotted (Y-axis).

  • ⁠@indicator⁠: A binary variable indicating the classification or grouping of points.

  • ⁠@tau⁠: A threshold value included in the plot's title.

  • ⁠@plvar2⁠: A matrix object defining the data points for the additional line in the plot.

y

Ignored. Included for compatibility with the generic plot function.

...

Additional arguments passed to the base R plot function.

Details

This method creates:

  • A scatter plot with points colored based on the value of indicator:

    • darkgreen for indicator = 1.

    • blue for other values.

  • An additional line, derived from the plvar2 matrix, drawn in black.

The title of the plot includes the threshold value (tau) for easier interpretation.

Value

This function does not return a value. It generates a plot as a side effect.


Example dataset

Description

Dataset containing measurements for leisure time (in minutes) and income based on expenditure share

Usage

pov_line_example

Format

a data.frame with 67335 rows and 3 columns:

leisure

Leisure time in minutes

inc_expenses

Income based on expenditure share of households

weight

Assumed population sampling weights

Source

Dorn, Franziska, et al. "A bivariate relative poverty line for leisure time and income poverty: Detecting intersectional differences using distributional copulas." Review of Income and Wealth 70.2 (2024): 395-419.