Files
OpenBB/website/versioned_docs/version-v3/terminal/reference/econometrics/index_cmd.md
Theodore Aptekarev f72bc8ccec Add Versioned Documentation (#5470)
* Adding versioning to docs

---------

Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
Co-authored-by: tehcoderer <me@tehcoderer.com>
2023-09-29 11:49:05 +02:00

13 KiB
Vendored

title, description
title description
index OpenBB Terminal Function

index

Set a (multi) index for the dataset

Usage

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

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       │
└────────────┴───────┴─────────┴───────┴───────┴──────┴─────────┴─────────┴───────┴───────┴───────┴─────────┴────────────┘