Pregunta 5
Pregunta 5
import numpy as np
import statsmodels.api as sm
# Datos
data = [
[1, 1962, 51.1, 560.3, 0.6, 16, 0],
[2, 1963, 52.3, 590.5, 0.9, 16.4, 0],
[3, 1964, 53.6, 632.4, 1.1, 16.7, 0],
[4, 1965, 49.6, 684.9, 1.4, 17, 1],
[5, 1966, 56.8, 749.9, 1.6, 20.2, 1],
[6, 1967, 70.1, 793.9, 1, 23.4, 1],
[7, 1968, 80.5, 865, 0.8, 25.6, 1],
[8, 1969, 81.2, 931.4, 1.5, 24.6, 1],
[9, 1970, 80.3, 992.7, 1, 24.8, 1],
[10, 1971, 77.7, 1077.6, 1.5, 21.7, 1],
[11, 1972, 78.3, 1185.9, 2.95, 21.5, 1],
[12, 1973, 74.5, 1326.4, 4.8, 24.3, 0],
[13, 1974, 77.8, 1434.2, 10.3, 26.8, 0],
[14, 1975, 85.6, 1549.2, 16, 29.5, 0],
[15, 1976, 89.4, 1718, 14.7, 30.4, 0],
[16, 1977, 97.5, 1918.3, 8.3, 33.3, 0],
[17, 1978, 105.2, 2163.9, 11, 38, 0],
[18, 1979, 117.7, 2417.8, 13, 46.2, 0],
[19, 1980, 135.9, 2633.1, 15.3, 57.6, 0],
[20, 1981, 162.1, 2937.7, 18, 68.9, 0],
]
# Crear DataFrame
columns = ["t", "Año", "Y", "X2", "X3", "X4", "X5"]
df = pd.DataFrame(data, columns=columns)
model_summary, model_params
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
[2] The condition number is large, 5.5e+03. This might indicate that there are
strong multicollinearity or other numerical problems.
""",
const 19.443447
X2 0.018056
X3 -0.284220
X4 1.343195
X5 6.331794
dtype: float64)
In [ ]: