options(scipen = 99999999)
load("C:/Users/Molin/Downloads/modelo_ventas.RData")
#Construyendo matriz A
Matriz_X.1<-model.matrix(modelo_ventas)
Matriz_XX.1<-t(Matriz_X.1)%*%Matriz_X.1
Matriz_A.1<-solve(Matriz_XX.1)%*%t(Matriz_X.1)
#Construyendo matriz P
Matriz_P.1<-(Matriz_X.1)%*%(Matriz_A.1)
#Constuyendo matriz M
n.1<-nrow(Matriz_X.1)
Matriz_M.1<-diag(n.1)-Matriz_P.1
library(magrittr)
## Warning: package 'magrittr' was built under R version 4.2.3
Residuos_modelo_ventas<-modelo_ventas$residuals
Datos_modelo<-modelo_ventas$model
Residuos_matrices<-Matriz_M.1%*%Datos_modelo$ventas
cbind(Residuos_matrices,Residuos_modelo_ventas, Residuos_modelo_ventas-Residuos_matrices)%>% round(digits = 2)%>% as.data.frame()->comparacion
names(comparacion)<-c("Por matrices", "En el modelo", "Diferencia")
comparacion
## Por matrices En el modelo Diferencia
## 1 -15.93 -15.93 0
## 2 19.33 19.33 0
## 3 38.02 38.02 0
## 4 -15.43 -15.43 0
## 5 5.16 5.16 0
## 6 80.22 80.22 0
## 7 -16.35 -16.35 0
## 8 -22.89 -22.89 0
## 9 -34.40 -34.40 0
## 10 46.09 46.09 0
## 11 -40.56 -40.56 0
## 12 9.25 9.25 0
## 13 5.82 5.82 0
## 14 -19.64 -19.64 0
## 15 -2.74 -2.74 0
## 16 -20.58 -20.58 0
## 17 -4.89 -4.89 0
## 18 -0.83 -0.83 0
## 19 -36.61 -36.61 0
## 20 -8.11 -8.11 0
## 21 11.00 11.00 0
## 22 56.50 56.50 0
## 23 -7.55 -7.55 0
## 24 31.71 31.71 0
## 25 -40.48 -40.48 0
## 26 86.80 86.80 0
## 27 -1.44 -1.44 0
## 28 35.92 35.92 0
## 29 24.51 24.51 0
## 30 -38.94 -38.94 0
## 31 25.44 25.44 0
## 32 -17.24 -17.24 0
## 33 -44.11 -44.11 0
## 34 47.62 47.62 0
## 35 -38.06 -38.06 0
## 36 104.56 104.56 0
## 37 -22.01 -22.01 0
## 38 6.26 6.26 0
## 39 -20.85 -20.85 0
## 40 -8.14 -8.14 0
## 41 3.52 3.52 0
## 42 7.13 7.13 0
## 43 39.33 39.33 0
## 44 29.22 29.22 0
## 45 -13.40 -13.40 0
## 46 8.21 8.21 0
## 47 -42.24 -42.24 0
## 48 -15.16 -15.16 0
## 49 36.15 36.15 0
## 50 -42.33 -42.33 0
## 51 29.60 29.60 0
## 52 -27.94 -27.94 0
## 53 -25.78 -25.78 0
## 54 -16.15 -16.15 0
## 55 20.52 20.52 0
## 56 -34.10 -34.10 0
## 57 32.84 32.84 0
## 58 -8.84 -8.84 0
## 59 -25.90 -25.90 0
## 60 4.38 4.38 0
## 61 -56.13 -56.13 0
## 62 -5.97 -5.97 0
## 63 34.06 34.06 0
## 64 -22.00 -22.00 0
## 65 -22.92 -22.92 0
## 66 -33.91 -33.91 0
## 67 -25.98 -25.98 0
## 68 -24.10 -24.10 0
## 69 15.18 15.18 0
## 70 -12.96 -12.96 0
## 71 -2.78 -2.78 0
## 72 -39.34 -39.34 0
## 73 9.10 9.10 0
## 74 -23.58 -23.58 0
## 75 16.53 16.53 0
## 76 41.92 41.92 0
## 77 -61.13 -61.13 0
## 78 -11.80 -11.80 0
## 79 42.30 42.30 0
## 80 -28.28 -28.28 0
## 81 -18.10 -18.10 0
## 82 55.90 55.90 0
## 83 -32.84 -32.84 0
## 84 1.99 1.99 0
## 85 -7.85 -7.85 0
## 86 2.06 2.06 0
## 87 -18.80 -18.80 0
## 88 -12.42 -12.42 0
## 89 -34.44 -34.44 0
## 90 -0.71 -0.71 0
## 91 -19.86 -19.86 0
## 92 -71.04 -71.04 0
## 93 5.47 5.47 0
## 94 -1.83 -1.83 0
## 95 -22.68 -22.68 0
## 96 -9.60 -9.60 0
## 97 30.46 30.46 0
## 98 2.80 2.80 0
## 99 -1.39 -1.39 0
## 100 -6.92 -6.92 0
## 101 47.13 47.13 0
## 102 13.67 13.67 0
## 103 74.24 74.24 0
## 104 8.29 8.29 0
## 105 5.20 5.20 0
## 106 -23.16 -23.16 0
## 107 -39.16 -39.16 0
## 108 -36.55 -36.55 0
## 109 -51.39 -51.39 0
## 110 14.93 14.93 0
## 111 31.77 31.77 0
## 112 0.85 0.85 0
## 113 3.55 3.55 0
## 114 20.05 20.05 0
## 115 1.25 1.25 0
## 116 -6.04 -6.04 0
## 117 -5.24 -5.24 0
## 118 -59.49 -59.49 0
## 119 -9.08 -9.08 0
## 120 -15.33 -15.33 0
## 121 -22.74 -22.74 0
## 122 -6.98 -6.98 0
## 123 52.60 52.60 0
## 124 -7.38 -7.38 0
## 125 6.99 6.99 0
## 126 -36.29 -36.29 0
## 127 51.55 51.55 0
## 128 -45.71 -45.71 0
## 129 -38.99 -38.99 0
## 130 -49.74 -49.74 0
## 131 137.77 137.77 0
## 132 68.15 68.15 0
## 133 29.49 29.49 0
## 134 4.04 4.04 0
## 135 2.44 2.44 0
## 136 24.96 24.96 0
## 137 14.83 14.83 0
## 138 18.65 18.65 0
## 139 -13.45 -13.45 0
## 140 -17.13 -17.13 0
## 141 -36.00 -36.00 0
## 142 -7.79 -7.79 0
## 143 -5.46 -5.46 0
## 144 -38.02 -38.02 0
## 145 -33.90 -33.90 0
## 146 -7.02 -7.02 0
## 147 57.02 57.02 0
## 148 -24.42 -24.42 0
## 149 5.76 5.76 0
## 150 -21.33 -21.33 0
## 151 60.96 60.96 0
## 152 -37.40 -37.40 0
## 153 3.70 3.70 0
## 154 -11.53 -11.53 0
## 155 5.57 5.57 0
## 156 20.34 20.34 0
## 157 -6.39 -6.39 0
## 158 0.10 0.10 0
## 159 35.21 35.21 0
## 160 -12.86 -12.86 0
## 161 -0.28 -0.28 0
## 162 -5.49 -5.49 0
## 163 7.07 7.07 0
## 164 -11.48 -11.48 0
## 165 -17.07 -17.07 0
## 166 43.48 43.48 0
## 167 30.49 30.49 0
## 168 32.76 32.76 0
## 169 9.33 9.33 0
## 170 79.25 79.25 0
## 171 -32.15 -32.15 0
## 172 -2.32 -2.32 0
## 173 -19.07 -19.07 0
## 174 11.45 11.45 0
## 175 56.81 56.81 0
## 176 -20.90 -20.90 0
## 177 10.72 10.72 0
## 178 10.72 10.72 0
## 179 99.16 99.16 0
## 180 0.68 0.68 0
## 181 8.07 8.07 0
## 182 43.24 43.24 0
## 183 -53.93 -53.93 0
## 184 -14.41 -14.41 0
## 185 33.06 33.06 0
## 186 -26.80 -26.80 0
## 187 -11.78 -11.78 0
## 188 2.02 2.02 0
## 189 75.55 75.55 0
## 190 -31.29 -31.29 0
## 191 11.46 11.46 0
## 192 -34.64 -34.64 0
## 193 -47.21 -47.21 0
## 194 -20.94 -20.94 0
## 195 -16.29 -16.29 0
## 196 -54.55 -54.55 0
## 197 -31.98 -31.98 0
## 198 8.34 8.34 0
## 199 -9.58 -9.58 0
## 200 49.59 49.59 0
eigen(x=Matriz_XX.1)->descomposicion
auto_valores<-descomposicion$values
print(auto_valores)
## [1] 311421698.6388 70252.5341 40973.4590 3714.3627 12.7735
print(auto_valores>0)
## [1] TRUE TRUE TRUE TRUE TRUE
options(scipen = 99999999)
load("C:/Users/Molin/Downloads/datos_cajas.RData")
modelo_cajas<-lm(formula=Tiempo~Distancia+N_cajas, data=datos_cajas)
stargazer::stargazer(modelo_cajas, title= "Regresión multiple del modelo de cajas", type = "text", digits = 8)
##
## Regresión multiple del modelo de cajas
## ===============================================
## Dependent variable:
## ---------------------------
## Tiempo
## -----------------------------------------------
## Distancia 0.45592080***
## (0.14676230)
##
## N_cajas 0.87720460***
## (0.15303460)
##
## Constant 2.31120200
## (5.85730300)
##
## -----------------------------------------------
## Observations 15
## R2 0.73678910
## Adjusted R2 0.69292060
## Residual Std. Error 3.14079000 (df = 12)
## F Statistic 16.79540000*** (df = 2; 12)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
#Construyendo matriz x
Matriz_X.2<-model.matrix(modelo_cajas)
Matriz_XX.2<-t(Matriz_X.2)%*%(Matriz_X.2)
#Construyendo matriz A
Matriz_A.2<-solve(Matriz_XX.2)%*%t(Matriz_X.2)
#Constuyendo matriz P
Matriz_P.2<-(Matriz_X.2)%*%(Matriz_A.2)
#Constuyendo matriz M
n.2<-nrow(Matriz_X.2)
Matriz_M.2<-diag(n.2)-Matriz_P.2
library(magrittr)
Residuos_modelo_cajas<-modelo_cajas$residuals
Datos_Modelo<-modelo_cajas$model
Residuos_matrices<-Matriz_M.2%*%Datos_Modelo$Tiempo
cbind(Residuos_matrices, Residuos_modelo_cajas, Residuos_modelo_cajas-Residuos_matrices)%>% round(digits=2) %>%as.data.frame()->comparacion
names(comparacion)<-c("Por matrices", "En el modelo", "Diferencia")
comparacion
## Por matrices En el modelo Diferencia
## 1 -0.76 -0.76 0
## 2 0.13 0.13 0
## 3 -0.32 -0.32 0
## 4 2.94 2.94 0
## 5 -9.27 -9.27 0
## 6 0.77 0.77 0
## 7 1.31 1.31 0
## 8 -2.09 -2.09 0
## 9 1.43 1.43 0
## 10 0.52 0.52 0
## 11 0.52 0.52 0
## 12 1.38 1.38 0
## 13 -1.02 -1.02 0
## 14 2.89 2.89 0
## 15 1.59 1.59 0
eigen(x=Matriz_XX.2)->descomposicion
Auto_valores<-descomposicion$values
print(Auto_valores)
## [1] 16976.7781334 709.9345923 0.2872743
print(Auto_valores>0)
## [1] TRUE TRUE TRUE
options(scipen = 999999999)
load("C:/Users/Molin/Downloads/modelo_estimado.RData")
#Construyendo matriz x
Matriz_X.3<-model.matrix(modelo_estimado_1)
Matriz_XX.3<-t(Matriz_X.3)%*%(Matriz_X.3)
#Construyendo matriz A
Matriz_A.3<-solve(Matriz_XX.3)%*%t(Matriz_X.3)
#Constuyendo matriz P
Matriz_P.3<-(Matriz_X.3)%*%(Matriz_A.3)
#Constuyendo matriz M
n.3<-nrow(Matriz_X.3)
Matriz_M.3<-diag(n.3)-Matriz_P.3
library(magrittr)
Residuos_modelo_estimado<-modelo_estimado_1$residuals
Datos_Modelo<-modelo_estimado_1$model
Residuos_matrices<-Matriz_M.3%*%Datos_Modelo$crime
cbind(Residuos_matrices, Residuos_modelo_estimado, Residuos_modelo_estimado-Residuos_matrices)%>% round(digits=2) %>%as.data.frame()->comparacion
names(comparacion)<-c("Por matrices", "En el modelo", "Diferencia")
comparacion
## Por matrices En el modelo Diferencia
## 1 -311.71 -311.71 0
## 2 116.80 116.80 0
## 3 45.25 45.25 0
## 4 -34.45 -34.45 0
## 5 243.00 243.00 0
## 6 -145.12 -145.12 0
## 7 86.13 86.13 0
## 8 88.31 88.31 0
## 9 689.82 689.82 0
## 10 -163.29 -163.29 0
## 11 60.90 60.90 0
## 12 126.92 126.92 0
## 13 -19.27 -19.27 0
## 14 322.59 322.59 0
## 15 -22.44 -22.44 0
## 16 128.18 128.18 0
## 17 -70.82 -70.82 0
## 18 -227.95 -227.95 0
## 19 287.10 287.10 0
## 20 303.88 303.88 0
## 21 -341.99 -341.99 0
## 22 -107.18 -107.18 0
## 23 -30.63 -30.63 0
## 24 189.45 189.45 0
## 25 -811.14 -811.14 0
## 26 -351.77 -351.77 0
## 27 102.71 102.71 0
## 28 -23.36 -23.36 0
## 29 73.38 73.38 0
## 30 -91.63 -91.63 0
## 31 324.03 324.03 0
## 32 -115.85 -115.85 0
## 33 113.65 113.65 0
## 34 217.94 217.94 0
## 35 -112.70 -112.70 0
## 36 21.38 21.38 0
## 37 -88.91 -88.91 0
## 38 99.42 99.42 0
## 39 -102.65 -102.65 0
## 40 217.88 217.88 0
## 41 -84.09 -84.09 0
## 42 137.78 137.78 0
## 43 48.89 48.89 0
## 44 -67.16 -67.16 0
## 45 -39.29 -39.29 0
## 46 -415.78 -415.78 0
## 47 -145.50 -145.50 0
## 48 -183.61 -183.61 0
## 49 -138.39 -138.39 0
## 50 -232.91 -232.91 0
## 51 434.17 434.17 0
eigen(x=Matriz_XX.3)->descomposicion
Auto_valores<-descomposicion$values
print(Auto_valores)
## [1] 17956.580914 279.157317 1.681762
print(Auto_valores>0)
## [1] TRUE TRUE TRUE
library(readxl)
Investiment_Equation <- read_excel("C:/Users/Molin/Downloads/Investiment_Equation.xlsx")
Ecuacion_inversion<-lm(formula = InvReal~Trend+Inflation+PNBr+Interest, data = Investiment_Equation)
library(stargazer)
stargazer(Ecuacion_inversion, tittle="Ecuación de Inversión", type = "text")
##
## ===============================================
## Dependent variable:
## ---------------------------
## InvReal
## -----------------------------------------------
## Trend -0.016***
## (0.002)
##
## Inflation 0.00002
## (0.001)
##
## PNBr 0.665***
## (0.054)
##
## Interest -0.240*
## (0.120)
##
## Constant -0.503***
## (0.054)
##
## -----------------------------------------------
## Observations 15
## R2 0.973
## Adjusted R2 0.962
## Residual Std. Error 0.007 (df = 10)
## F Statistic 90.089*** (df = 4; 10)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
##
## =====================
## Ecuación de Inversión
## ---------------------
model.matrix(Ecuacion_inversion)->Matriz_x.4
n.4<-nrow(Matriz_x.4)
Matriz_M.4<-diag(n.4)-Matriz_x.4%*%solve(t(Matriz_x.4)%*%Matriz_x.4)%*%t(Matriz_x.4)
Y<-Investiment_Equation$InvReal
residuos.4<-Matriz_M.4%*%Y
print(residuos.4)
## [,1]
## 1 -0.0100602233
## 2 -0.0009290882
## 3 0.0029656679
## 4 0.0078576839
## 5 0.0028109133
## 6 0.0006259732
## 7 0.0075909286
## 8 -0.0055352778
## 9 -0.0037254127
## 10 0.0006953129
## 11 0.0019904770
## 12 -0.0001288433
## 13 -0.0101976729
## 14 0.0068712384
## 15 -0.0008316770
confint(object = Ecuacion_inversion, parm = "PNBr", level = .93)
## 3.5 % 96.5 %
## PNBr 0.554777 0.774317
De realizarce el ejercicio repetidas veces, el 93 por ciento de los casos que se inclemente en 1 millón de dolares el PNBr, el InvReal incrementaria como minimo .55 de millón de dolares y como máximo .77 de millón de dolares. # Ejercicio 5 a. Calcule los residuos del modelo
options(scipen = 999999)
load("C:/Users/Molin/Downloads/consumption_equation.RData")
n.5<-nrow(P)
M.5<-diag(n.5)-P
residuos.5<-M.5%*%C
print(residuos.5)
## [,1]
## 1 -5.859103
## 2 2.605057
## 3 45.765735
## 4 31.102448
## 5 -21.037889
## 6 7.008120
## 7 17.859663
## 8 10.705631
## 9 22.002328
## 10 -2.689665
## 11 7.784083
## 12 -13.127696
## 13 17.521565
## 14 17.304695
## 15 -16.308260
## 16 -5.255508
## 17 2.788211
## 18 -16.379339
## 19 -14.327554
## 20 11.749135
## 21 -31.424669
## 22 -23.329596
## 23 22.171806
## 24 -5.040038
## 25 -36.191398
## 26 -25.211753
## 27 -21.411271
## 28 1.410519
## 29 -24.229564
## 30 20.971808
## 31 43.342653
## 32 36.808458
## 33 17.882297
## 34 -33.100273
## 35 -37.819995
## 36 -49.370820
## 37 23.456143
## 38 -25.510341
## 39 -11.960629
## 40 -9.234201
## 41 21.949616
## 42 3.211123
## 43 -14.511436
## 44 3.197576
## 45 -62.396763
## 46 -66.854500
## 47 8.330745
## 48 91.963380
## 49 61.620735
## 50 48.148861
## 51 -10.717721
## 52 -84.069717
## 53 -56.426627
## 54 125.113605
#Sigma cuadrado
var_error=t(residuos.5)%*%residuos.5/(n.5-4)
print(var_error)
## [,1]
## [1,] 1428.746
var_error<-as.vector(var_error)
Var_cov<-var_error*solve(XX)
print(Var_cov)
## (Intercept) Yd W I
## (Intercept) 164.522304918 -0.09333539523 0.009670913575 10.5186890800
## Yd -0.093335395 0.00018911268 -0.000032769561 -0.0072901023
## W 0.009670914 -0.00003276956 0.000006165749 0.0004193421
## I 10.518689080 -0.00729010228 0.000419342092 5.3203789879
C_estimada<-P%*%C
cuadro<-as.data.frame(cbind(C,C_estimada,residuos.5))
names(cuadro)<-c("C","C_estimada","Residuos")
print(head(cuadro))
## C C_estimada Residuos
## 1 976.4 982.2591 -5.859103
## 2 998.1 995.4949 2.605057
## 3 1025.3 979.5343 45.765735
## 4 1090.9 1059.7976 31.102448
## 5 1107.1 1128.1379 -21.037889
## 6 1142.4 1135.3919 7.008120
load("C:/Users/Molin/Downloads/datos_ventas.RData")
Ecuacion_inversion.1<-lm(formula = ventas~tv+radio+periodico, data = datos_ventas)
library(stargazer)
stargazer(Ecuacion_inversion.1, tittle="Ecuación de Inversión", type = "text")
##
## ===============================================
## Dependent variable:
## ---------------------------
## ventas
## -----------------------------------------------
## tv 0.045
## (0.118)
##
## radio -3.450***
## (0.206)
##
## periodico 18.485***
## (0.563)
##
## Constant -33.289***
## (7.172)
##
## -----------------------------------------------
## Observations 200
## R2 0.847
## Adjusted R2 0.844
## Residual Std. Error 33.875 (df = 196)
## F Statistic 360.758*** (df = 3; 196)
## ===============================================
## Note: *p<0.1; **p<0.05; ***p<0.01
##
## =====================
## Ecuación de Inversión
## ---------------------
model.matrix(Ecuacion_inversion.1)->Matriz_x.6
n.6<-nrow(Matriz_x.6)
Matriz_M.6<-diag(n.6)-Matriz_x.6%*%solve(t(Matriz_x.6)%*%Matriz_x.6)%*%t(Matriz_x.6)
Y<-datos_ventas$ventas
residuos.6<-Matriz_M.6%*%Y
print(residuos.6)
## [,1]
## 1 -17.8524638
## 2 19.0821552
## 3 33.7931916
## 4 -17.3508987
## 5 10.2572135
## 6 74.2038531
## 7 -15.2465204
## 8 -23.4242974
## 9 -39.6405207
## 10 45.1613878
## 11 -40.6649446
## 12 8.9590198
## 13 5.1392043
## 14 -22.6236420
## 15 -2.4070766
## 16 -23.2129522
## 17 -8.8531474
## 18 -2.2553254
## 19 -36.4998224
## 20 -7.7078500
## 21 12.1068249
## 22 56.1602254
## 23 -4.4128052
## 24 32.1887265
## 25 -41.0755512
## 26 85.5635292
## 27 -0.5813419
## 28 36.0534051
## 29 25.1740669
## 30 -36.8482228
## 31 26.2868044
## 32 -15.4987679
## 33 -43.1444263
## 34 46.2272722
## 35 -42.1231189
## 36 101.1406281
## 37 -18.4643544
## 38 4.6103727
## 39 -19.7868698
## 40 -7.5311456
## 41 4.4398079
## 42 7.6680340
## 43 39.7209714
## 44 29.5192706
## 45 -12.0296830
## 46 9.1587903
## 47 -40.4095721
## 48 -13.3392963
## 49 39.1663986
## 50 -40.4133097
## 51 31.4947034
## 52 -31.1473697
## 53 -26.0085689
## 54 -19.2664951
## 55 21.2230654
## 56 -38.1989298
## 57 33.9900112
## 58 -9.0293035
## 59 -26.4532617
## 60 5.2080674
## 61 -57.0047861
## 62 -7.9150425
## 63 34.6127519
## 64 -21.0722866
## 65 -22.0009918
## 66 -37.5816067
## 67 -26.0583831
## 68 -25.5511822
## 69 15.6898060
## 70 -11.9155347
## 71 -2.0728694
## 72 -38.2242913
## 73 10.3876466
## 74 -22.3937288
## 75 16.7129825
## 76 36.0899293
## 77 -62.1710571
## 78 -11.0250420
## 79 43.4373665
## 80 -28.5252657
## 81 -17.3349979
## 82 58.2041869
## 83 -31.7292205
## 84 2.1957465
## 85 -7.5263700
## 86 6.0297930
## 87 -18.0886178
## 88 -14.5646838
## 89 -32.2092742
## 90 -3.0357398
## 91 -22.9596676
## 92 -69.3639459
## 93 5.2832261
## 94 -3.5250431
## 95 -24.0859349
## 96 -9.1837060
## 97 26.4214991
## 98 3.1212001
## 99 -2.9193041
## 100 -7.6730899
## 101 52.0041912
## 102 10.4210157
## 103 73.7871802
## 104 7.9854131
## 105 6.9306678
## 106 -26.3200156
## 107 -38.1956964
## 108 -37.1411765
## 109 -51.3551775
## 110 15.2312039
## 111 37.1313178
## 112 2.0545188
## 113 1.3651902
## 114 19.5562302
## 115 1.4943123
## 116 -6.1604300
## 117 -4.8525782
## 118 -61.9776211
## 119 -11.2002151
## 120 -15.1234596
## 121 -21.5609770
## 122 -4.7202419
## 123 50.4386227
## 124 -5.7864987
## 125 6.7136905
## 126 -35.9140143
## 127 50.9977671
## 128 -49.5940852
## 129 -34.1058846
## 130 -46.9621445
## 131 140.6245747
## 132 71.7959550
## 133 30.0581974
## 134 4.3121884
## 135 0.7502335
## 136 28.9102154
## 137 17.3960181
## 138 19.5045244
## 139 -12.7465335
## 140 -13.0911168
## 141 -36.7362018
## 142 -9.2131004
## 143 -4.9409642
## 144 -36.2423122
## 145 -31.9387023
## 146 -10.6584048
## 147 54.1763052
## 148 -25.9962973
## 149 8.2843516
## 150 -20.6385139
## 151 62.6625611
## 152 -33.3544363
## 153 3.7729886
## 154 -11.3760631
## 155 5.0805779
## 156 17.9950120
## 157 -7.8494101
## 158 -0.2201702
## 159 35.3022384
## 160 -11.5540752
## 161 0.6591253
## 162 -5.5871655
## 163 7.5462798
## 164 -9.3303245
## 165 -19.0175482
## 166 55.7263685
## 167 32.0402256
## 168 31.6353338
## 169 11.4108832
## 170 76.5904762
## 171 -32.7991015
## 172 -0.2825814
## 173 -19.0264844
## 174 9.3293014
## 175 54.2493038
## 176 -22.1047290
## 177 11.5543472
## 178 12.5352601
## 179 98.7318828
## 180 -0.3195726
## 181 4.3908269
## 182 43.6649823
## 183 -53.0060931
## 184 -18.3203130
## 185 33.8772333
## 186 -24.7792769
## 187 -11.5610805
## 188 2.7811315
## 189 73.1591927
## 190 -31.1749134
## 191 14.6672356
## 192 -37.2279106
## 193 -45.8529068
## 194 -17.4973688
## 195 -14.2672641
## 196 -56.8557034
## 197 -35.2780738
## 198 5.4730833
## 199 -12.5781921
## 200 46.9637691
confint(object = Ecuacion_inversion.1, parm = "tv", level = .968)
## 1.6 % 98.4 %
## tv -0.2097376 0.2998052
De realizarce el ejercicio repetidas veces, el 96.8 por ciento de los casos que se gate 1 millón de dolares el publicidad para la televisión, las ventas se ventas de la empresa caerían a -0.2 millones de dolares como minimo y aumentaría a 0.2 millones de dolares como maximo.