Miscellaneous Functions for Panel Data, Quantiles, and Printing Results
Overview
These are miscellaneous functions for working with panel data, quantiles, and printing results. For panel data, the package includes functions for making a panel data balanced (that is, dropping missing individuals that have missing observations in any time period), converting id numbers to row numbers, and to treat repeated cross sections as panel data under the assumption of rank invariance. For quantiles, there are functions to make distribution functions from a set of data points (this is particularly useful when a distribution function is created in several steps), to combine distribution functions based on some external weights, and to invert distribution functions. Finally, there are several other miscellaneous functions for obtaining weighted means, weighted distribution functions, and weighted quantiles; to generate summary statistics and their differences for two groups; and to add or drop covariates from formulas. Additional utilities support staggered treatment adoption settings, including functions for identifying treatment groups, recovering pre-treatment outcomes and covariate averages, and computing lagged outcomes and first differences in panel data.
- Smaller footprint and improved performance.
- Removed the
dplyrandtidyrdependencies. The affected functions are now implemented withdata.table, which was already a dependency, leading to a total reduction of ~20 packages (incl. strong recursive deps). - The workhorse panel "getter" functions (
get_group(),get_Yit(),check_staggered(), etc.) have also been vectorized, yielding substantial performance improvements. On a simulated 200k row / 20k unit panel dataset, we observe 150-1400x speed gains, combined with an order of magnitude smaller memory allocation(s). - Bug fixes:
check_staggered()no longer (automatically) returnsFALSEfor panels with any treatment adoption. Previously, this function only returnedTRUEwhen no unit ever changed treatment status.
Show all changes in 1.4.10Hide the rest of the changes in 1.4.10
get_Yit()now returnsNAfor units that are not observed in periodtp. Previously such units contributed nothing to the result, so the returned vector was shorter than the number of rows in the data.- New features:
check_staggered()andcheck_staggered_inner()gain an optionaltnameargument. The check compares consecutive rows, so it is only meaningful when a unit's rows are in time order; supplyingtnamesorts them first. The default (NULL) keeps the previous assumption that the data is already ordered.- Other changes:
get_principal_components()now returns units in sorted id order. This is only a change for data that is not already sorted by id, where it previously used order of first appearance, and it makes the function consistent with the other panel data getters.get_first_difference()no longer adds a temporary.lagcolumn to a copy of the input data, and now works when passed adata.table.- Fixed silent row misalignment in several vectorized panel getters (
get_group(),get_Yit(),get_principal_components(), etc.) when units were not sorted by id; addedsort_panel()andset_balanced_panel(), andmake_balanced_panel()now preserves its input's class instead of taking areturn_data.tableargument.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-02
Show 6 earlier changesHide 6 earlier changes
- ERROR11 OK, 1 ERROR2026-04-25
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-04-08
- ERROR13 OK, 1 ERROR2026-04-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 73 (28 internal)includes a package overview page
- Examples that run
- 98%41 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 58%
- Documented parameters
- 96%
- Return-value docs
- 53%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 67%
- Median days to close, 50 most recently updated closed issues
- 1,124
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
10 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/bcallaway11/bmisc on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-08-22
pkgdown site last built 2026-08-21, before release 1.4.10 (2026-08-22)
Show all practicesHide 1 practice
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-05-21Named in .Rbuildignore: .claudeCommits: at least 22 crediting it in the message
- Claude Sonnet 4.618 commits · May 2026
- Claude Sonnet 54 commits · Aug 2026
Dependencies
Installing BMisc adds 3 packages (3 with compiled code, 8.5 MB of source tarballs). Heaviest: data.table 5.7 MB, Rcpp 1.8 MB, RcppArmadillo 1.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.4.10Latest
- 1.4.92026-06-11 · diff ↗
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 1.4.82025-02-04 · diff ↗ ·
added 19 exports
add_cov_to_formula, block_boot_sample, combine_ecdfs, compare_binary, compare_binary_inner, drop_cov_from_formula, get_list_element, id2rownum, invert_ecdf, lhs_vars, make_balanced_panel, make_dist, rhs_vars, weighted_checkfun, weighted_combine_list, weighted_ecdf, weighted_mean, weighted_quantile, weighted_quantile_inner - 1.4.72025-01-10 · diff ↗ ·
added 10 exports
check_staggered, check_staggered_inner, drop_collinear, get_principal_components, mv_mult, orig2t, orig2t_inner, t2orig, t2orig_inner, time_invariant_to_panel - RR 4.4.0 released · 2024-04-24
- 1.4.62024-03-09 · diff ↗ ·
added 15 exports
element_wise_mult, get_Yi1, get_Yi1_inner, get_YiGmin1, get_YiGmin1_inner, get_Yibar, get_Yibar_inner, get_Yibar_pre, get_Yibar_pre_inner, get_Yit, get_Yit_inner, get_first_difference, get_group, get_group_inner, get_lagYi - RR 4.3.0 released · 2023-04-21
- unarchivedReturned to CRAN2022-07-11
- 1.4.52022-07-11 · diff ↗
- archivedRemoved from CRAN2022-07-09check problems were not corrected in time , Does not use 'plm' conditionally, and that was for a time uninstallable
- RR 4.2.0 released · 2022-04-22
- 1.4.42022-01-26 · diff ↗
- 1.4.3
- RR 4.1.0 released · 2021-05-18
Show 12 earlier eventsHide 12 earlier events
Package metadata
- First published
- 2017-06-14
- Total releases
- 16 / 9 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 91 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("BMisc")The package provides a citation file, so citation() returns the authors' own entry.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.