mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-31 22:41:19 +00:00
* Add Statistics Menu * Add Granger Causality test * Apply Black formatting * Add Cointegration Tests * Adjust plotting for Cointegration test * Add Significant parameter to Cointegration tests * Move regression functions to seperate .py files * Progress on Panel Data * A lot of progress for Panel Data * Make functions robust and improve documentation * Re-enable Breusch-Godfrey * Add modify functionality * Improve modify functionality * Add Breusch-Pagan heteroscedasticity test * Capitalize a word * Include documentatin for the Statistics Menu * Update _index.md * Update _index.md * Update _index.md * Fix export statements and add Example datasets * Update example with Longley's dataset * Update documentation with a legit source * Compare the results from each regression models based on the wage_panel dataset * Updated with all relevant types of regression tables * Update with all relevant regression types for Panel data * Update _index.md * Add change column type, improve OLS, add time and entity effects for FE * Update documentation and fix a small bug * Add in Statistics menu, replacing Custom menu * Remove custom menu * Add in documentation * Add in gst files * Cointegration can be used on any amount of columns * Add Tests * Make tests time invariant * Update Poetry and Requirements * Change name of Statistics menu to Econometrics menu * Rename scripts * Add type in Documentation * Change names from Statistics to Econometrics * Add graph * Update tests with rounding and naming * Make minor adjustments to fix the tests * Updating tests : allow extra args for capture * Apply recorder formatting * Adding some minor formatting * Fix error with MyPy * Attempt to fix MyPy annoyance * super small style things * Fix small bugs and add plot command to dwat * Small description mistake * Update documentation with missing argument * Update styling * Add error handling and add improve show functionality * Fix merge issue * Allow import from custom_imports Co-authored-by: Jeroen Bouma <jeroenbouma@MacBook-Pro-van-Jeroen.local> Co-authored-by: jmaslek <jmaslek11@gmail.com> Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
18 KiB
Vendored
18 KiB
Vendored
usage: load [-f FILE [FILE ...]] [-ex] [-h]
Load custom data set into a DataFrame. If a column exists titled "date", "time", "timestamp", "quarter" is automatically converted to a date format and is set as index of the DataFrame.
The load function also has the ability to load in custom datasets from Statsmodels. These datasets tend to be quite illustrative for different regression techniques and statistical tests. See the example below for the available options.
optional arguments:
-f FILE [FILE ...], --file FILE [FILE ...]
File to load in and the alias you wish to give to the dataset (default: None)
-ex, --examples Use this argument to show examples of Statsmodels to load in. See: https://www.statsmodels.org/devel/datasets/index.html (default: False)
-h, --help show this help message (default: False)
Example:
2022 Feb 28, 04:19 (✨) /econometrics/ $ load MSFT_20220221_140503.xlsx msft
2022 Feb 28, 04:20 (✨) /econometrics/ $ show msft
msft
┏━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ┃ date ┃ open ┃ high ┃ low ┃ close ┃ adj_close ┃ volume ┃
┡━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━┩
│ 0 │ 2019-02-19 00:00:00 │ 107.79 │ 108.66 │ 107.78 │ 108.17 │ 104.38 │ 18038500 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 1 │ 2019-02-20 00:00:00 │ 107.86 │ 107.94 │ 106.29 │ 107.15 │ 103.84 │ 21607700 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 2 │ 2019-02-21 00:00:00 │ 106.90 │ 109.48 │ 106.87 │ 109.41 │ 106.03 │ 29063200 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 3 │ 2019-02-22 00:00:00 │ 110.05 │ 111.20 │ 109.82 │ 110.97 │ 107.54 │ 27763200 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 4 │ 2019-02-25 00:00:00 │ 111.76 │ 112.18 │ 111.26 │ 111.59 │ 108.14 │ 23750600 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 5 │ 2019-02-26 00:00:00 │ 111.26 │ 113.24 │ 111.17 │ 112.36 │ 108.89 │ 21536700 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 6 │ 2019-02-27 00:00:00 │ 111.69 │ 112.36 │ 110.88 │ 112.17 │ 108.71 │ 21487100 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 7 │ 2019-02-28 00:00:00 │ 112.04 │ 112.88 │ 111.73 │ 112.03 │ 108.57 │ 29083900 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 8 │ 2019-03-01 00:00:00 │ 112.89 │ 113.02 │ 111.67 │ 112.53 │ 109.06 │ 23501200 │
├───┼─────────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤
│ 9 │ 2019-03-04 00:00:00 │ 113.02 │ 113.25 │ 110.80 │ 112.26 │ 108.79 │ 26608000 │
└───┴─────────────────────┴────────┴────────┴────────┴────────┴───────────┴──────────┘
2022 Feb 28, 04:16 (✨) /econometrics/ $ load --ex
Examples from Statsmodels
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ file name ┃ description ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ anes96 │ American National Election Survey 1996 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ cancer │ Breast Cancer Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ ccard │ Bill Greene’s credit scoring data. │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ cancer_china │ Smoking and lung cancer in eight cities in China. │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ co2 │ Mauna Loa Weekly Atmospheric CO2 Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ committee │ First 100 days of the US House of Representatives 1995 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ copper │ World Copper Market 1951-1975 Dataset │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ cpunish │ US Capital Punishment dataset. │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ danish_data │ Danish Money Demand Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ elnino │ El Nino - Sea Surface Temperatures │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ engel │ Engel (1857) food expenditure data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ fair │ Affairs dataset │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ fertility │ World Bank Fertility Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ grunfeld │ Grunfeld (1950) Investment Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ health │ Transplant Survival Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ interest_inflation │ (West) German interest and inflation rate 1972-1998 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ longley │ Longley dataset │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ macrodata │ United States Macroeconomic data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ modechoice │ Travel Mode Choice │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ nile │ Nile River flows at Ashwan 1871-1970 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ randhie │ RAND Health Insurance Experiment Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ scotland │ Taxation Powers Vote for the Scottish Parliament 1997 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ spector │ Spector and Mazzeo (1980) - Program Effectiveness Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ stackloss │ Stack loss data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ star98 │ Star98 Educational Dataset │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ statecrim │ Statewide Crime Data 2009 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ strikes │ U.S. Strike Duration Data │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ sunspots │ Yearly sunspots data 1700-2008 │
├────────────────────┼───────────────────────────────────────────────────────────┤
│ wage_panel │ Veila and M. Verbeek (1998): Whose Wages Do Unions Raise? │
└────────────────────┴───────────────────────────────────────────────────────────┘
2022 Feb 28, 04:17 (✨) /econometrics/ $ load grunfeld gf
2022 Feb 28, 04:20 (✨) /econometrics/ $ desc gf
gf
┏━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
┃ ┃ invest ┃ value ┃ capital ┃ year ┃
┡━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
│ count │ 220.00 │ 220.00 │ 220.00 │ 220.00 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ mean │ 133.31 │ 988.58 │ 257.11 │ 1944.50 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ std │ 210.59 │ 1287.30 │ 293.23 │ 5.78 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ min │ 0.93 │ 30.28 │ 0.80 │ 1935.00 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ 25% │ 27.38 │ 160.32 │ 67.10 │ 1939.75 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ 50% │ 52.36 │ 404.65 │ 180.10 │ 1944.50 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ 75% │ 99.78 │ 1605.93 │ 344.50 │ 1949.25 │
├───────┼─────────┼─────────┼─────────┼─────────┤
│ max │ 1486.70 │ 6241.70 │ 2226.30 │ 1954.00 │
└───────┴─────────┴─────────┴─────────┴─────────┘