LM17021
23/4/2020
library(dplyr)
library(readr)
ejercicio_doss <- read_csv("E:/ejercicio_doss.csv")
head(ejercicio_doss,n = 6)## # A tibble: 6 x 3
## X1 X2 Y
## <dbl> <dbl> <dbl>
## 1 5 7.14 32
## 2 53 5.1 450
## 3 60 4.2 370
## 4 63 3.9 470
## 5 69 1.4 420
## 6 82 2.2 500
library(stargazer)
options(scipen = 9999)
modelo_lineal2<-lm(formula = Y~X1+X2,data = ejercicio_doss)
summary(modelo_lineal2)##
## Call:
## lm(formula = Y ~ X1 + X2, data = ejercicio_doss)
##
## Residuals:
## Min 1Q Median 3Q Max
## -151.194 -49.312 1.857 60.555 226.223
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 61.0133 57.4367 1.062 0.303
## X1 4.0919 0.2752 14.866 0.0000000000357 ***
## X2 14.2466 5.9759 2.384 0.029 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 97.09 on 17 degrees of freedom
## Multiple R-squared: 0.9316, Adjusted R-squared: 0.9236
## F-statistic: 115.8 on 2 and 17 DF, p-value: 0.0000000001251
##
## Ejercicio de Regresión Multiple
## ================================================
## Dependent variable:
## ----------------------------
## Y
## ------------------------------------------------
## X1 4.09185700***
## (0.27524100)
##
## X2 14.24664000**
## (5.97585600)
##
## Constant 61.01329000
## (57.43673000)
##
## ------------------------------------------------
## Observations 20
## R2 0.93161220
## Adjusted R2 0.92356660
## Residual Std. Error 97.08614000 (df = 17)
## F Statistic 115.79120000*** (df = 2; 17)
## ================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## (Intercept) X1 X2
## 61.013290 4.091857 14.246644
## (Intercept) X1 X2
## (Intercept) 3298.97753 -10.75297606 -201.68414674
## X1 -10.75298 0.07575761 -0.09534885
## X2 -201.68415 -0.09534885 35.71085958
## 2.5 % 97.5 %
## (Intercept) -60.167610 182.194190
## X1 3.511150 4.672565
## X2 1.638689 26.854599
## [,1]
## 1 183.1936
## 2 350.5396
## 3 366.3606
## 4 374.3622
## 5 363.2967
## 6 427.8882
## 7 569.9255
## 8 567.7723
## 9 710.0242
## 10 826.5997
## 11 747.4498
## 12 842.9547
## 13 951.6784
## 14 1037.2755
## 15 1043.6379
## 16 1077.2510
## 17 1125.1432
## 18 1197.0725
## 19 1223.7769
## 20 1195.7976
## [,1]
## [1,] -151.19361215
## [2,] 99.46039163
## [3,] 3.63936998
## [4,] 95.63779125
## [5,] 56.70325673
## [6,] 72.11179721
## [7,] 0.07447666
## [8,] 72.22768431
## [9,] -40.02419425
## [10,] -46.59969203
## [11,] -57.44976423
## [12,] -142.95472376
## [13,] -41.67835643
## [14,] -107.27550981
## [15,] -103.63786615
## [16,] -7.25098127
## [17,] 34.85683775
## [18,] 12.92749838
## [19,] 226.22314707
## [20,] 24.20244912