Path: blob/main/Trabajo_grupal/WG4/Grupo_4_jupyter (1).ipynb
2714 views
Kernel: Python 3 (ipykernel)
Work Group 4:
Integrantes:
Ascencios, Seidy - 20191622
Morales, Luana - 2019120
Oré, Flavia - 20191215
Quintero, Marcela - 20191445
In [1]:
Out[1]:
Requirement already satisfied: pyreadr in d:\anaconda\lib\site-packages (0.4.6)
Requirement already satisfied: pandas>=1.2.0 in d:\anaconda\lib\site-packages (from pyreadr) (1.2.4)
Requirement already satisfied: numpy>=1.16.5 in d:\anaconda\lib\site-packages (from pandas>=1.2.0->pyreadr) (1.20.1)
Requirement already satisfied: pytz>=2017.3 in d:\anaconda\lib\site-packages (from pandas>=1.2.0->pyreadr) (2021.1)
Requirement already satisfied: python-dateutil>=2.7.3 in d:\anaconda\lib\site-packages (from pandas>=1.2.0->pyreadr) (2.8.1)
Requirement already satisfied: six>=1.5 in d:\anaconda\lib\site-packages (from python-dateutil>=2.7.3->pandas>=1.2.0->pyreadr) (1.15.0)
Crear una Clase OLS con las siguientes características: Los atributos: DataFrame de variables explicativas. El vector de la variable Y Una lista que permita seleccionar las variables del DataFrame (puede ser posiciones o no nombre de variables) Una variable booleana para errores estándar robustas
In [2]:
In [3]:
Out[3]:
year lnw female widowed divorced separated nevermarried \
0 2012.0 1.909543 1.0 0.0 0.0 0.0 0.0
1 2012.0 1.365773 1.0 0.0 0.0 0.0 0.0
2 2012.0 2.540223 0.0 0.0 0.0 0.0 0.0
3 2012.0 1.801091 1.0 0.0 0.0 0.0 0.0
4 2012.0 3.349904 0.0 0.0 0.0 0.0 0.0
... ... ... ... ... ... ... ...
29212 2012.0 3.978513 0.0 0.0 0.0 0.0 1.0
29213 2012.0 3.142265 1.0 0.0 0.0 0.0 1.0
29214 2012.0 2.725619 1.0 0.0 0.0 0.0 0.0
29215 2012.0 3.142265 0.0 0.0 0.0 0.0 0.0
29216 2012.0 2.433613 1.0 0.0 0.0 0.0 0.0
hsd08 hsd911 hsg ... so we exp1 exp2 exp3 exp4 weight \
0 0.0 0.0 0.0 ... 0.0 0.0 22.0 4.84 10.648 23.4256 569.43
1 0.0 1.0 0.0 ... 0.0 0.0 30.0 9.00 27.000 81.0000 625.96
2 0.0 0.0 1.0 ... 0.0 0.0 19.0 3.61 6.859 13.0321 264.22
3 0.0 0.0 1.0 ... 0.0 0.0 14.0 1.96 2.744 3.8416 256.81
4 0.0 0.0 0.0 ... 0.0 0.0 15.0 2.25 3.375 5.0625 256.81
... ... ... ... ... ... ... ... ... ... ... ...
29212 0.0 0.0 0.0 ... 0.0 1.0 27.0 7.29 19.683 53.1441 301.43
29213 0.0 0.0 0.0 ... 0.0 1.0 16.0 2.56 4.096 6.5536 206.36
29214 0.0 0.0 0.0 ... 0.0 1.0 21.0 4.41 9.261 19.4481 272.35
29215 0.0 0.0 0.0 ... 0.0 1.0 2.0 0.04 0.008 0.0016 282.87
29216 0.0 0.0 0.0 ... 0.0 1.0 2.0 0.04 0.008 0.0016 282.87
married ne sc
0 True True True
1 True True False
2 True True False
3 True True False
4 True True False
... ... ... ...
29212 False False False
29213 False False False
29214 True False True
29215 True False False
29216 True False False
[29217 rows x 23 columns]
In [23]:
In [27]:
In [36]:
Out[36]:
0.6495008509803024
In [34]:
Out[34]:
[[ 2.9094181 ]
[-0.25887621]
[-0.17751519]]