# rifexpectile

<!-- badges: start -->
[![R-CMD-check](https://github.com/aandoye/rifexpectile/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/aandoye/rifexpectile/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/rifexpectile)](https://CRAN.R-project.org/package=rifexpectile)
<!-- badges: end -->

Density-free RIF (recentered influence function) regressions for
unconditional expectiles, embedded in a two-sample Oaxaca-Blinder
decomposition indexed continuously by the expectile level. Unlike
quantile-based RIF decompositions, which require estimating an inverse
density term at each quantile, the expectile RIF depends only on
primitive moments of the outcome and requires no density estimation, no
bandwidth choice, and no kernel smoothing.

## Installation

```r
install.packages("rifexpectile")
```

Development version from GitHub:
```r
# install.packages("remotes")
remotes::install_github("aandoye/rifexpectile", build_vignettes = TRUE)
```

## Example

```r
library(rifexpectile)
data(wage_gap_sim)

fit <- rif_decompose(
  logy ~ x1 + x2,
  data = wage_gap_sim,
  group = "group",
  ref_group = "2000",
  alpha = seq(0.1, 0.9, by = 0.2),
  boot_reps = 200,
  seed = 1
)
fit
plot(fit, which = "structure")
```

See `vignette("rifexpectile-intro")` for a full walkthrough, including an
example with the publicly available `wage1` data set from the
**wooldridge** package.

## Methodology

The closed-form expectile influence function, the two-sample asymptotic
theory, and an empirical application are described in a companion
manuscript (Ndoye, 2026, unpublished). This package focuses on the
software; see `?rif_decompose` for the exact algebra of the decomposition
implemented here.

## License

MIT
