Files
OpenBB/website/content/terminal/reference/econometrics/index_cmd.md
DidierRLopes 4ad995fdd0 Docs/terminalpro and improvement (#5622)
* add first iteration of content for Terminal Pro

* Update index.md

* Update dashboards.md

* Update folders.md

* Update grouping.md

* Update report.md

* Update templates.md

* Update quick-start.md

* Update index.md

* Update index.md

* Update home.md

* Update news.md

* Update index.md

* Update index.md

* Update index.md

* Update data-provider.md

* Update chat-with-widget.md

* Update data-manipulation.md

* Update forecasting.md

* fix: images self closing tags

* fix: only pro visitors can see pro

* inter font

* improve SEO content and restructuring

* add new package for toggle on tutorials

* move folder around

* improve main page of each prod

* small updates and improvements

* fix logo above

* small improvement in headtitle for portfolio funcs

* fix typos from OpenAI's GPT-4

* fix _category_ json

* remove generic SEO words

* add script that generates SEO for documentation

* add missing file

* remove sdk warning message

* fix links for andrew

---------

Co-authored-by: jose-donato <zmcdonato@gmail.com>
Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com>
Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
2023-10-30 21:01:29 +00:00

107 lines
13 KiB
Markdown
Vendored

---
title: index
description: This page of the documentation describes how to set a (multi)index for
a dataset. It includes parameters for selecting the dataset, the default index,
data adjustments for regressions, and dropping the column that the index is set
for. Examples using Python are provided.
keywords:
- indexing
- dataset
- default index
- dataset adjustment
- timeseries regression
- panel data regression
- drop column
- data management
---
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
<HeadTitle title="econometrics /index - Reference | OpenBB Terminal Docs" />
Set a (multi) index for the dataset
### Usage
```python
index -n {} [-i INDEX] [-a] [-d]
```
---
## Parameters
| Name | Description | Default | Optional | Choices |
| ---- | ----------- | ------- | -------- | ------- |
| name | Name of dataset to select index from | None | False | None |
| index | Columns from the dataset the user wishes to set as default | | True | None |
| adjustment | Whether to allow for making adjustments to the dataset to align it with the use case for Timeseries and Panel Data regressions | False | True | None |
| drop | Whether to drop the column(s) the index is set for. | False | True | None |
---
## Examples
```python
2022 Jun 01, 06:39 (🦋) /econometrics/ $ load wage_panel -a wp
2022 Jun 01, 06:39 (🦋) /econometrics/ $ show wp
Dataset wp | Showing 10 of 4360 rows
┏━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓
┃ ┃ nr ┃ year ┃ black ┃ exper ┃ hisp ┃ hours ┃ married ┃ educ ┃ union ┃ lwage ┃ expersq ┃ occupation ┃
┡━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━┩
│ 0 │ 13.00 │ 1980.00 │ 0.00 │ 1.00 │ 0.00 │ 2672.00 │ 0.00 │ 14.00 │ 0.00 │ 1.20 │ 1.00 │ 9.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 1 │ 13.00 │ 1981.00 │ 0.00 │ 2.00 │ 0.00 │ 2320.00 │ 0.00 │ 14.00 │ 1.00 │ 1.85 │ 4.00 │ 9.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 2 │ 13.00 │ 1982.00 │ 0.00 │ 3.00 │ 0.00 │ 2940.00 │ 0.00 │ 14.00 │ 0.00 │ 1.34 │ 9.00 │ 9.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 3 │ 13.00 │ 1983.00 │ 0.00 │ 4.00 │ 0.00 │ 2960.00 │ 0.00 │ 14.00 │ 0.00 │ 1.43 │ 16.00 │ 9.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 4 │ 13.00 │ 1984.00 │ 0.00 │ 5.00 │ 0.00 │ 3071.00 │ 0.00 │ 14.00 │ 0.00 │ 1.57 │ 25.00 │ 5.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 5 │ 13.00 │ 1985.00 │ 0.00 │ 6.00 │ 0.00 │ 2864.00 │ 0.00 │ 14.00 │ 0.00 │ 1.70 │ 36.00 │ 2.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 6 │ 13.00 │ 1986.00 │ 0.00 │ 7.00 │ 0.00 │ 2994.00 │ 0.00 │ 14.00 │ 0.00 │ -0.72 │ 49.00 │ 2.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 7 │ 13.00 │ 1987.00 │ 0.00 │ 8.00 │ 0.00 │ 2640.00 │ 0.00 │ 14.00 │ 0.00 │ 1.67 │ 64.00 │ 2.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 8 │ 17.00 │ 1980.00 │ 0.00 │ 4.00 │ 0.00 │ 2484.00 │ 0.00 │ 13.00 │ 0.00 │ 1.68 │ 16.00 │ 2.00 │
├───┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ 9 │ 17.00 │ 1981.00 │ 0.00 │ 5.00 │ 0.00 │ 2804.00 │ 0.00 │ 13.00 │ 0.00 │ 1.52 │ 25.00 │ 2.00 │
└───┴───────┴─────────┴───────┴───────┴──────┴─────────┴─────────┴───────┴───────┴───────┴─────────┴────────────┘
2022 Jun 01, 06:39 (🦋) /econometrics/ $ index wp -i nr,year
Successfully updated 'wp' index to be 'nr, year'
2022 Jun 01, 06:39 (🦋) /econometrics/ $ show wp
Dataset wp | Showing 10 of 4360 rows
┏━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓
┃ ┃ nr ┃ year ┃ black ┃ exper ┃ hisp ┃ hours ┃ married ┃ educ ┃ union ┃ lwage ┃ expersq ┃ occupation ┃
┡━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━┩
│ (13, 1980) │ 13.00 │ 1980.00 │ 0.00 │ 1.00 │ 0.00 │ 2672.00 │ 0.00 │ 14.00 │ 0.00 │ 1.20 │ 1.00 │ 9.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1981) │ 13.00 │ 1981.00 │ 0.00 │ 2.00 │ 0.00 │ 2320.00 │ 0.00 │ 14.00 │ 1.00 │ 1.85 │ 4.00 │ 9.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1982) │ 13.00 │ 1982.00 │ 0.00 │ 3.00 │ 0.00 │ 2940.00 │ 0.00 │ 14.00 │ 0.00 │ 1.34 │ 9.00 │ 9.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1983) │ 13.00 │ 1983.00 │ 0.00 │ 4.00 │ 0.00 │ 2960.00 │ 0.00 │ 14.00 │ 0.00 │ 1.43 │ 16.00 │ 9.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1984) │ 13.00 │ 1984.00 │ 0.00 │ 5.00 │ 0.00 │ 3071.00 │ 0.00 │ 14.00 │ 0.00 │ 1.57 │ 25.00 │ 5.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1985) │ 13.00 │ 1985.00 │ 0.00 │ 6.00 │ 0.00 │ 2864.00 │ 0.00 │ 14.00 │ 0.00 │ 1.70 │ 36.00 │ 2.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1986) │ 13.00 │ 1986.00 │ 0.00 │ 7.00 │ 0.00 │ 2994.00 │ 0.00 │ 14.00 │ 0.00 │ -0.72 │ 49.00 │ 2.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (13, 1987) │ 13.00 │ 1987.00 │ 0.00 │ 8.00 │ 0.00 │ 2640.00 │ 0.00 │ 14.00 │ 0.00 │ 1.67 │ 64.00 │ 2.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (17, 1980) │ 17.00 │ 1980.00 │ 0.00 │ 4.00 │ 0.00 │ 2484.00 │ 0.00 │ 13.00 │ 0.00 │ 1.68 │ 16.00 │ 2.00 │
├────────────┼───────┼─────────┼───────┼───────┼──────┼─────────┼─────────┼───────┼───────┼───────┼─────────┼────────────┤
│ (17, 1981) │ 17.00 │ 1981.00 │ 0.00 │ 5.00 │ 0.00 │ 2804.00 │ 0.00 │ 13.00 │ 0.00 │ 1.52 │ 25.00 │ 2.00 │
└────────────┴───────┴─────────┴───────┴───────┴──────┴─────────┴─────────┴───────┴───────┴───────┴─────────┴────────────┘
```
---