https://github.com/mightymetrika/gifistab
A Stability Assessment Framework
https://github.com/mightymetrika/gifistab
datascience r research statistics
Last synced: 9 months ago
JSON representation
A Stability Assessment Framework
- Host: GitHub
- URL: https://github.com/mightymetrika/gifistab
- Owner: mightymetrika
- License: other
- Created: 2023-07-09T16:52:06.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-30T15:56:27.000Z (almost 3 years ago)
- Last Synced: 2025-06-18T21:45:16.803Z (about 1 year ago)
- Topics: datascience, r, research, statistics
- Language: R
- Homepage:
- Size: 205 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# gifistab
The gifistab R package aims to provide a robust framework for the stability assessment of statistical models. This framework, based on the broad definitions of seven types of stability as presented in [Michailides and de Leeuw (1998)](https://escholarship.org/uc/item/0789f7d3), includes:
1) Replication Stability. Given a newly sampled dataset, the application of the same technique should yield results that do not change dramatically.
2) Statistical Stability. This refers to the stability of the analysis when no new dataset is formally sampled.
3) Stability under Data Selection. This involves considering variations in data by either omitting objects from the dataset or variables from the subsequent analysis. The former corresponds to the rejection of outliers and resampling techniques. Resampling techniques can be considered a form of replication stability without the formal sampling of a new dataset.
4) Stability under Model Selection. Small changes in the model should yield only minor alterations in the results.
5) Numerical Stability. This refers to the impact of rounding errors and computations with limited precision on the results produced by the techniques.
6) Analytic and Algebraic Stability. Given sufficient mathematical structure in the data and potential representations, formal expressions of the input-output analysis can be derived by considering perturbations of the input.
7) Stability under Selection of Technique. The application of different techniques to the same dataset, with the goal of answering the same question, should yield approximately the same information.
## Installation
You can install the development version of gifistab from GitHub using [devtools](https://devtools.r-lib.org/):
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("mightymetrika/gifistab")
```
## Example
The following is a basic example illustrating how to perform a stability assessment using the stats::lm engine:
```{r example}
library(gifistab)
stab_res <- suppressWarnings(stability_assessment(data = n20_seed376_lm, # Input data frame
new_data = n20_seed500_lm, # A new data frame
nboot = 1000,
variable_to_remove = "x2",
variable_of_interest = "x1",
formula = y ~ x1 + x2,
engine = stats::lm,
seed = 184))
```
From the stab_res object, you can further explore the type of stability assessment you're interested in by accessing summary tables, plots, and explanations. For instance, you can explore the 'Stability under Selection of Technique' assessment as follows:
```{r}
# View table for the original model
stab_res$gstab_summary$original_summary
# View table for the stability under selection of technique model
stab_res$gstab_summary$technique_stability_summary
# View plot
stab_res$gstab_plot$technique_stability_plot
# View explanation
stab_res$gstab_explainer$`Stability under Selection of Technique`
```