Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carloscinelli/sValues
Measures of the sturdiness of regression coefficients.
https://github.com/carloscinelli/sValues
Last synced: 3 days ago
JSON representation
Measures of the sturdiness of regression coefficients.
- Host: GitHub
- URL: https://github.com/carloscinelli/sValues
- Owner: carloscinelli
- Created: 2015-08-02T20:27:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T07:21:09.000Z (over 6 years ago)
- Last Synced: 2024-08-03T06:03:24.848Z (3 months ago)
- Language: R
- Size: 664 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output:
md_document:
variant: markdown_github
---[![Travis-CI Build Status](https://travis-ci.org/carloscinelli/sValues.svg?branch=master)](https://travis-ci.org/carloscinelli/sValues)
[![Build status](https://ci.appveyor.com/api/projects/status/cplf2u9uxgmapk0n/branch/master?svg=true)](https://ci.appveyor.com/project/carloscinelli/svalues/branch/master)
[![Coverage Status](https://img.shields.io/codecov/c/github/carloscinelli/sValues/master.svg)](https://codecov.io/github/carloscinelli/sValues?branch=master)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sValues)](https://cran.r-project.org/web/packages/sValues/)
![](http://cranlogs.r-pkg.org/badges/sValues)```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/"
)
```The `sValues` package implements the measures of the sturdiness of regression coefficients (s-values) proposed and discussed by Ed. Leamer in [1] and [2].
## CRAN
You can install the package from CRAN by running:
```{r, eval = FALSE}
install.packages("sValues")
```## How to install the development version from GitHub
To install the GitHub version you need to have the package `devtools` installed. Make sure to set the option `build_vignettes = TRUE` to compile the package vignette.
```{r, eval = FALSE}
# install.packages("devtools") # run this to install the devtools package
devtools::install_github("carloscinelli/sValues", build_vignettes = TRUE)
```## Example usage
The `sValues` package comes with an example dataset on economic growth. This dataset comprises the growth of real GDP per capita from 1960 to 1996 and other 67 explanatory variables from 87 countries.The main function of the package is the `sValues` function. The standard approach is to provide a `formula` specifying the model, a `data.frame` with the data and a numerical vector with the $R^2$ bounds (default values are $0.1$, $0.5$, and $1$). As a shortcut, you can omit the formula and the function will automatically consider the first column as the dependent variable and the rest as the independent variables. Let's run the analysis for the economic growth data.
```{r}
library(sValues) # loads package
data("economic_growth") # loads data
eg <- sValues(economic_growth) # runs analysis
eg # prints basic results
plot(eg)
```As we can see from the results, only in the "optimistic"" scenario some variables are robust to model ambiguity. Moreover, if we look at the sample uncertainty (t-values), there is only one variable (`IPRICE1`) which has both $|s| > 1$ and $|t| > 2$. What the s-values are telling you is that any precise inferences about the sign of almost all the coefficients *require stronger prior information about preference for some variables*.
More information can be found on the help documentation, examples and package vignette.
## References
[[1] Leamer, E. (2016). S-values: Conventional context-minimal measures of the sturdiness of regression coefficients. Journal of Econometrics](http://www.sciencedirect.com/science/article/pii/S0304407616300185)
[[2] Leamer, E. (2016). S-values and bayesian weighted all-subsets regressions. European Economic Review.](http://www.sciencedirect.com/science/article/pii/S0014292115000641)