set.seed(63)
n <- 50
p <- 4

x1 <- runif(n,2,8)
x1
##  [1] 7.443602 3.199079 2.183129 2.469121 6.132703 6.430821 2.172322 3.256888
##  [9] 6.246868 2.462558 2.851426 2.137584 5.937666 6.803620 5.315992 4.921033
## [17] 2.294779 7.657396 5.984844 5.502151 5.893828 5.246506 4.656814 4.911963
## [25] 5.800488 5.684382 5.425778 4.524447 4.426171 6.130309 5.516585 7.382769
## [33] 4.097203 6.895651 6.916217 2.352784 6.980575 4.737644 7.299384 5.626433
## [41] 7.041479 2.901964 3.296324 7.014547 3.141965 6.608809 6.366991 3.985501
## [49] 3.388720 3.812493
x2 <- rnorm(n,4,2)
x2
##  [1]  7.6657284  5.5352423  1.3173874  4.9690198  4.2565515  1.2491062
##  [7]  4.8364762  5.1373174  3.7492187  5.9788875  5.3275852  0.9352684
## [13]  7.1361043  5.9613023  5.7158665  3.3638208  4.0009726  3.9005609
## [19]  2.0418834 -2.0495445  7.0063487  4.9366907  6.4307318  4.4945520
## [25]  3.6131859  5.1060200  4.2123411  4.1729056  1.5207286  3.4043452
## [31] -0.9737384  3.0554797  2.4302053  2.1460595  7.0303639  2.7843831
## [37]  5.2633882  2.2825684  4.6055670  2.5369922  4.0690412  5.1786996
## [43]  5.9619462  2.2433481  4.2369069  6.4229336  3.8199649  3.3809268
## [49]  1.3076792  4.4785719
x0 <- rep(1,n)
x0
##  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
## [39] 1 1 1 1 1 1 1 1 1 1 1 1
x <- data.frame(x0,x1,x2)
x
##    x0       x1         x2
## 1   1 7.443602  7.6657284
## 2   1 3.199079  5.5352423
## 3   1 2.183129  1.3173874
## 4   1 2.469121  4.9690198
## 5   1 6.132703  4.2565515
## 6   1 6.430821  1.2491062
## 7   1 2.172322  4.8364762
## 8   1 3.256888  5.1373174
## 9   1 6.246868  3.7492187
## 10  1 2.462558  5.9788875
## 11  1 2.851426  5.3275852
## 12  1 2.137584  0.9352684
## 13  1 5.937666  7.1361043
## 14  1 6.803620  5.9613023
## 15  1 5.315992  5.7158665
## 16  1 4.921033  3.3638208
## 17  1 2.294779  4.0009726
## 18  1 7.657396  3.9005609
## 19  1 5.984844  2.0418834
## 20  1 5.502151 -2.0495445
## 21  1 5.893828  7.0063487
## 22  1 5.246506  4.9366907
## 23  1 4.656814  6.4307318
## 24  1 4.911963  4.4945520
## 25  1 5.800488  3.6131859
## 26  1 5.684382  5.1060200
## 27  1 5.425778  4.2123411
## 28  1 4.524447  4.1729056
## 29  1 4.426171  1.5207286
## 30  1 6.130309  3.4043452
## 31  1 5.516585 -0.9737384
## 32  1 7.382769  3.0554797
## 33  1 4.097203  2.4302053
## 34  1 6.895651  2.1460595
## 35  1 6.916217  7.0303639
## 36  1 2.352784  2.7843831
## 37  1 6.980575  5.2633882
## 38  1 4.737644  2.2825684
## 39  1 7.299384  4.6055670
## 40  1 5.626433  2.5369922
## 41  1 7.041479  4.0690412
## 42  1 2.901964  5.1786996
## 43  1 3.296324  5.9619462
## 44  1 7.014547  2.2433481
## 45  1 3.141965  4.2369069
## 46  1 6.608809  6.4229336
## 47  1 6.366991  3.8199649
## 48  1 3.985501  3.3809268
## 49  1 3.388720  1.3076792
## 50  1 3.812493  4.4785719
e <- rnorm(n,0,3)
e
##  [1] -0.61576235 -3.90811132 -2.53814462  2.82924643  0.10873425  1.81487474
##  [7] -5.82592401  4.16611392  5.44237898 -1.16175189 -1.07035005 -5.41321895
## [13] -3.79812941 -0.11733874 -4.74779868 -0.83157965  0.27351354  4.36445295
## [19]  3.57903144  2.27584535  3.68709064 -1.37931672  1.28425311 -3.05977951
## [25] -0.15877211  7.64209161 -3.62809790 -2.68928745  0.99479787 -0.06017638
## [31]  3.37981194 -2.60335355 -5.32157641 -0.21906431  0.75163365  2.40124902
## [37]  3.94086837 -0.46857226  1.42249754 -0.33350101  4.12322136  0.26777212
## [43]  2.41276666  1.60491736 -4.48606622  1.79315898 -0.33078031 -1.13252427
## [49] -2.38230226 -1.80150167
y <- 4 + 2*x1 + 3*x2 + e
rand.comp <- data.frame(e,y)
rand.comp
##              e         y
## 1  -0.61576235 41.268627
## 2  -3.90811132 23.095774
## 3  -2.53814462  9.780275
## 4   2.82924643 26.674549
## 5   0.10873425 29.143794
## 6   1.81487474 22.423835
## 7  -5.82592401 17.028148
## 8   4.16611392 30.091843
## 9   5.44237898 33.183771
## 10 -1.16175189 25.700026
## 11 -1.07035005 24.615257
## 12 -5.41321895  5.667755
## 13 -3.79812941 33.485517
## 14 -0.11733874 35.373808
## 15 -4.74779868 27.031784
## 16 -0.83157965 23.101948
## 17  0.27351354 20.865989
## 18  4.36445295 35.380927
## 19  3.57903144 25.674369
## 20  2.27584535 11.131513
## 21  3.68709064 40.493793
## 22 -1.37931672 27.923768
## 23  1.28425311 33.890077
## 24 -3.05977951 24.247802
## 25 -0.15877211 26.281762
## 26  7.64209161 38.328915
## 27 -3.62809790 23.860482
## 28 -2.68928745 22.878324
## 29  0.99479787 18.409326
## 30 -0.06017638 26.413476
## 31  3.37981194 15.491767
## 32 -2.60335355 25.328624
## 33 -5.32157641 14.163446
## 34 -0.21906431 24.010416
## 35  0.75163365 39.675159
## 36  2.40124902 19.459966
## 37  3.94086837 37.692184
## 38 -0.46857226 19.854420
## 39  1.42249754 33.837966
## 40 -0.33350101 22.530342
## 41  4.12322136 34.413303
## 42  0.26777212 25.607799
## 43  2.41276666 30.891253
## 44  1.60491736 26.364057
## 45 -4.48606622 18.508585
## 46  1.79315898 38.279577
## 47 -0.33078031 27.863096
## 48 -1.13252427 20.981258
## 49 -2.38230226 12.318175
## 50 -1.80150167 23.259199
dt <- data.frame(y,x1,x2)
dt
##            y       x1         x2
## 1  41.268627 7.443602  7.6657284
## 2  23.095774 3.199079  5.5352423
## 3   9.780275 2.183129  1.3173874
## 4  26.674549 2.469121  4.9690198
## 5  29.143794 6.132703  4.2565515
## 6  22.423835 6.430821  1.2491062
## 7  17.028148 2.172322  4.8364762
## 8  30.091843 3.256888  5.1373174
## 9  33.183771 6.246868  3.7492187
## 10 25.700026 2.462558  5.9788875
## 11 24.615257 2.851426  5.3275852
## 12  5.667755 2.137584  0.9352684
## 13 33.485517 5.937666  7.1361043
## 14 35.373808 6.803620  5.9613023
## 15 27.031784 5.315992  5.7158665
## 16 23.101948 4.921033  3.3638208
## 17 20.865989 2.294779  4.0009726
## 18 35.380927 7.657396  3.9005609
## 19 25.674369 5.984844  2.0418834
## 20 11.131513 5.502151 -2.0495445
## 21 40.493793 5.893828  7.0063487
## 22 27.923768 5.246506  4.9366907
## 23 33.890077 4.656814  6.4307318
## 24 24.247802 4.911963  4.4945520
## 25 26.281762 5.800488  3.6131859
## 26 38.328915 5.684382  5.1060200
## 27 23.860482 5.425778  4.2123411
## 28 22.878324 4.524447  4.1729056
## 29 18.409326 4.426171  1.5207286
## 30 26.413476 6.130309  3.4043452
## 31 15.491767 5.516585 -0.9737384
## 32 25.328624 7.382769  3.0554797
## 33 14.163446 4.097203  2.4302053
## 34 24.010416 6.895651  2.1460595
## 35 39.675159 6.916217  7.0303639
## 36 19.459966 2.352784  2.7843831
## 37 37.692184 6.980575  5.2633882
## 38 19.854420 4.737644  2.2825684
## 39 33.837966 7.299384  4.6055670
## 40 22.530342 5.626433  2.5369922
## 41 34.413303 7.041479  4.0690412
## 42 25.607799 2.901964  5.1786996
## 43 30.891253 3.296324  5.9619462
## 44 26.364057 7.014547  2.2433481
## 45 18.508585 3.141965  4.2369069
## 46 38.279577 6.608809  6.4229336
## 47 27.863096 6.366991  3.8199649
## 48 20.981258 3.985501  3.3809268
## 49 12.318175 3.388720  1.3076792
## 50 23.259199 3.812493  4.4785719
par(mfrow=c(1,2))
plot(x1,y,pch=19)
plot(x2,y,pch=19)

#Matriks
y <- as.matrix(y)
y
##            [,1]
##  [1,] 41.268627
##  [2,] 23.095774
##  [3,]  9.780275
##  [4,] 26.674549
##  [5,] 29.143794
##  [6,] 22.423835
##  [7,] 17.028148
##  [8,] 30.091843
##  [9,] 33.183771
## [10,] 25.700026
## [11,] 24.615257
## [12,]  5.667755
## [13,] 33.485517
## [14,] 35.373808
## [15,] 27.031784
## [16,] 23.101948
## [17,] 20.865989
## [18,] 35.380927
## [19,] 25.674369
## [20,] 11.131513
## [21,] 40.493793
## [22,] 27.923768
## [23,] 33.890077
## [24,] 24.247802
## [25,] 26.281762
## [26,] 38.328915
## [27,] 23.860482
## [28,] 22.878324
## [29,] 18.409326
## [30,] 26.413476
## [31,] 15.491767
## [32,] 25.328624
## [33,] 14.163446
## [34,] 24.010416
## [35,] 39.675159
## [36,] 19.459966
## [37,] 37.692184
## [38,] 19.854420
## [39,] 33.837966
## [40,] 22.530342
## [41,] 34.413303
## [42,] 25.607799
## [43,] 30.891253
## [44,] 26.364057
## [45,] 18.508585
## [46,] 38.279577
## [47,] 27.863096
## [48,] 20.981258
## [49,] 12.318175
## [50,] 23.259199
X <- as.matrix(cbind(x0,x1,x2))
X
##       x0       x1         x2
##  [1,]  1 7.443602  7.6657284
##  [2,]  1 3.199079  5.5352423
##  [3,]  1 2.183129  1.3173874
##  [4,]  1 2.469121  4.9690198
##  [5,]  1 6.132703  4.2565515
##  [6,]  1 6.430821  1.2491062
##  [7,]  1 2.172322  4.8364762
##  [8,]  1 3.256888  5.1373174
##  [9,]  1 6.246868  3.7492187
## [10,]  1 2.462558  5.9788875
## [11,]  1 2.851426  5.3275852
## [12,]  1 2.137584  0.9352684
## [13,]  1 5.937666  7.1361043
## [14,]  1 6.803620  5.9613023
## [15,]  1 5.315992  5.7158665
## [16,]  1 4.921033  3.3638208
## [17,]  1 2.294779  4.0009726
## [18,]  1 7.657396  3.9005609
## [19,]  1 5.984844  2.0418834
## [20,]  1 5.502151 -2.0495445
## [21,]  1 5.893828  7.0063487
## [22,]  1 5.246506  4.9366907
## [23,]  1 4.656814  6.4307318
## [24,]  1 4.911963  4.4945520
## [25,]  1 5.800488  3.6131859
## [26,]  1 5.684382  5.1060200
## [27,]  1 5.425778  4.2123411
## [28,]  1 4.524447  4.1729056
## [29,]  1 4.426171  1.5207286
## [30,]  1 6.130309  3.4043452
## [31,]  1 5.516585 -0.9737384
## [32,]  1 7.382769  3.0554797
## [33,]  1 4.097203  2.4302053
## [34,]  1 6.895651  2.1460595
## [35,]  1 6.916217  7.0303639
## [36,]  1 2.352784  2.7843831
## [37,]  1 6.980575  5.2633882
## [38,]  1 4.737644  2.2825684
## [39,]  1 7.299384  4.6055670
## [40,]  1 5.626433  2.5369922
## [41,]  1 7.041479  4.0690412
## [42,]  1 2.901964  5.1786996
## [43,]  1 3.296324  5.9619462
## [44,]  1 7.014547  2.2433481
## [45,]  1 3.141965  4.2369069
## [46,]  1 6.608809  6.4229336
## [47,]  1 6.366991  3.8199649
## [48,]  1 3.985501  3.3809268
## [49,]  1 3.388720  1.3076792
## [50,]  1 3.812493  4.4785719
b <- solve(t(X)%*%X)%*%t(X)%*%y; round(b,4)
##      [,1]
## x0 0.9507
## x1 2.6625
## x2 2.9378
#Mengakses Elemen
b0 <- b[1];b0
## [1] 0.9507033
b1 <- b[2];b1
## [1] 2.662476
b2 <-b[3]; b2
## [1] 2.937815
#Varians Residual
sigma_kuadrat <- (t(y)%*%y-t(b)%*%t(X)%*%y)/(n-p)
sigma_kuadrat
##          [,1]
## [1,] 8.590475
#Residual Standart Error
Res_se <- sqrt(sigma_kuadrat)
Res_se
##          [,1]
## [1,] 2.930951
#Pembulatan
round(Res_se,3)
##       [,1]
## [1,] 2.931
df <- n-p
df
## [1] 46
y_duga <- b0+b1*x1+b2*x2
y_duga
##  [1] 43.289605 25.729693 10.633470 22.122741 29.783835 21.742249 20.943131
##  [8] 24.714578 28.597348 25.072070 24.194015  9.389615 37.724151 36.578379
## [15] 31.896560 23.935117 18.814615 32.797460 22.883880  9.578862 37.226234
## [22] 29.422482 32.241659 27.232847 27.009234 31.085774 27.771785 25.256159
## [29] 17.202895 27.273837 12.777812 29.583581 18.998900 25.614931 40.018872
## [36] 15.394936 34.999176 20.270328 33.915439 23.384159 31.652559 23.891174
## [43] 27.242181 26.217306 21.763358 37.415886 29.125011 21.494540 13.814807
## [50] 24.258588
Y <- data.frame(y,y_duga);Y
##            y    y_duga
## 1  41.268627 43.289605
## 2  23.095774 25.729693
## 3   9.780275 10.633470
## 4  26.674549 22.122741
## 5  29.143794 29.783835
## 6  22.423835 21.742249
## 7  17.028148 20.943131
## 8  30.091843 24.714578
## 9  33.183771 28.597348
## 10 25.700026 25.072070
## 11 24.615257 24.194015
## 12  5.667755  9.389615
## 13 33.485517 37.724151
## 14 35.373808 36.578379
## 15 27.031784 31.896560
## 16 23.101948 23.935117
## 17 20.865989 18.814615
## 18 35.380927 32.797460
## 19 25.674369 22.883880
## 20 11.131513  9.578862
## 21 40.493793 37.226234
## 22 27.923768 29.422482
## 23 33.890077 32.241659
## 24 24.247802 27.232847
## 25 26.281762 27.009234
## 26 38.328915 31.085774
## 27 23.860482 27.771785
## 28 22.878324 25.256159
## 29 18.409326 17.202895
## 30 26.413476 27.273837
## 31 15.491767 12.777812
## 32 25.328624 29.583581
## 33 14.163446 18.998900
## 34 24.010416 25.614931
## 35 39.675159 40.018872
## 36 19.459966 15.394936
## 37 37.692184 34.999176
## 38 19.854420 20.270328
## 39 33.837966 33.915439
## 40 22.530342 23.384159
## 41 34.413303 31.652559
## 42 25.607799 23.891174
## 43 30.891253 27.242181
## 44 26.364057 26.217306
## 45 18.508585 21.763358
## 46 38.279577 37.415886
## 47 27.863096 29.125011
## 48 20.981258 21.494540
## 49 12.318175 13.814807
## 50 23.259199 24.258588
#Koefisien Determinasi R^2
R_squared <- (cor(y,y_duga))^2;round(R_squared,4)
##        [,1]
## [1,] 0.8817
#Koefisien Determinasi Adjusted R^2
R_squared_adj <- 1-((1-R_squared)*(n-1)/(n-p));round(R_squared_adj,4)
##       [,1]
## [1,] 0.874
KTReg <- sum((y_duga-mean(y))^2)/(p-1)
KTReg
## [1] 982.0865
galat <- y-(b0+b1*x1+b2*x2)
galat
##              [,1]
##  [1,] -2.02097819
##  [2,] -2.63391857
##  [3,] -0.85319568
##  [4,]  4.55180799
##  [5,] -0.64004167
##  [6,]  0.68158570
##  [7,] -3.91498227
##  [8,]  5.37726480
##  [9,]  4.58642286
## [10,]  0.62795628
## [11,]  0.42124160
## [12,] -3.72186008
## [13,] -4.23863437
## [14,] -1.20457137
## [15,] -4.86477647
## [16,] -0.83316823
## [17,]  2.05137482
## [18,]  2.58346792
## [19,]  2.79048973
## [20,]  1.55265160
## [21,]  3.26755862
## [22,] -1.49871481
## [23,]  1.64841784
## [24,] -2.98504522
## [25,] -0.72747177
## [26,]  7.24314117
## [27,] -3.91130312
## [28,] -2.37783509
## [29,]  1.20643073
## [30,] -0.86036055
## [31,]  2.71395462
## [32,] -4.25495647
## [33,] -4.83545467
## [34,] -1.60451517
## [35,] -0.34371249
## [36,]  4.06503018
## [37,]  2.69300739
## [38,] -0.41590748
## [39,] -0.07747261
## [40,] -0.85381635
## [41,]  2.76074321
## [42,]  1.71662502
## [43,]  3.64907167
## [44,]  0.14675026
## [45,] -3.25477340
## [46,]  0.86369048
## [47,] -1.26191536
## [48,] -0.51328213
## [49,] -1.49663180
## [50,] -0.99938910
KTG   <- sum(galat^2)/(n-p)
KTG
## [1] 8.590475
Fhit  <- KTReg/KTG;round(Fhit,0)
## [1] 114
dbreg <- p-1;dbreg
## [1] 3
dbg <- n-p;dbg
## [1] 46
pf(Fhit, dbreg, dbg, lower.tail = F)
## [1] 2.452363e-21
se_b <- sqrt(sigma_kuadrat[1]*solve(t(X)%*%X))
## Warning in sqrt(sigma_kuadrat[1] * solve(t(X) %*% X)): NaNs produced
se_b
##          x0        x1        x2
## x0 1.485893       NaN       NaN
## x1      NaN 0.2468127       NaN
## x2      NaN       NaN 0.2070745
se_b0 <- se_b[1,1];round(se_b0,4)
## [1] 1.4859
se_b0
## [1] 1.485893
se_b1 <- se_b[2,2];round(se_b1,4)
## [1] 0.2468
se_b1
## [1] 0.2468127
se_b2 <- se_b[3,3];round(se_b2,4)
## [1] 0.2071
se_b2
## [1] 0.2070745
t_b0 <- b0/se_b0;round(t_b0,2)
## [1] 0.64
2*pt(-abs(t_b0 ),df <- n-p)
## [1] 0.5254639
t_b1 <- b1/se_b1;round(t_b1,2)
## [1] 10.79
2*pt(-abs(t_b1 ),df <- n-p)
## [1] 3.458614e-14
t_b2 <- b2/se_b2;round(t_b2,2)
## [1] 14.19
2*pt(-abs(t_b2 ),df <- n-p)
## [1] 2.046557e-18
t <- qt(.975, df <- n-p)

BB_b0 <- b0-t*se_b0
BB_b0
## [1] -2.040244
BA_b0 <- b0+t*se_b0
BA_b0
## [1] 3.94165
BB_b1 <- b1-t*se_b1
BB_b1
## [1] 2.165667
BA_b1 <- b1+t*se_b1
BA_b1
## [1] 3.159284
BB_b2 <- b2-t*se_b2
BB_b2
## [1] 2.520996
BA_b2 <- b2+t*se_b2
BA_b2
## [1] 3.354635
Batas.Bawah <- as.matrix(c(round(BB_b0,6),round(BB_b1,6),round(BB_b2,6)))
Batas.Bawah
##           [,1]
## [1,] -2.040244
## [2,]  2.165667
## [3,]  2.520996
Batas.Atas <- as.matrix(c(round(BA_b0,6),round(BA_b1,6),round(BA_b2,6)))
Batas.Atas
##          [,1]
## [1,] 3.941650
## [2,] 3.159284
## [3,] 3.354635
Selang.Kepercayaan <- cbind(Batas.Bawah, Batas.Atas)
Selang.Kepercayaan
##           [,1]     [,2]
## [1,] -2.040244 3.941650
## [2,]  2.165667 3.159284
## [3,]  2.520996 3.354635
colnames(Selang.Kepercayaan ) <- c("Batas bawah Selang (2.5%)", "Batas atas Selang (97.5%)")
colnames(Selang.Kepercayaan)
## [1] "Batas bawah Selang (2.5%)" "Batas atas Selang (97.5%)"
rownames(Selang.Kepercayaan ) <- c("Intersept", "b1", "b2")
rownames(Selang.Kepercayaan)
## [1] "Intersept" "b1"        "b2"
Selang.Kepercayaan
##           Batas bawah Selang (2.5%) Batas atas Selang (97.5%)
## Intersept                 -2.040244                  3.941650
## b1                         2.165667                  3.159284
## b2                         2.520996                  3.354635
reg <- lm(y~x1+x2, data= dt)
summary(reg)
## 
## Call:
## lm(formula = y ~ x1 + x2, data = dt)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.8648 -1.5781 -0.4646  1.9677  7.2431 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.9507     1.4700   0.647    0.521    
## x1            2.6625     0.2442  10.904 1.82e-14 ***
## x2            2.9378     0.2049  14.341  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.9 on 47 degrees of freedom
## Multiple R-squared:  0.8817, Adjusted R-squared:  0.8767 
## F-statistic: 175.2 on 2 and 47 DF,  p-value: < 2.2e-16
anova(reg)
## Analysis of Variance Table
## 
## Response: y
##           Df  Sum Sq Mean Sq F value    Pr(>F)    
## x1         1 1217.19 1217.19  144.77 5.898e-16 ***
## x2         1 1729.07 1729.07  205.65 < 2.2e-16 ***
## Residuals 47  395.16    8.41                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
confint(reg)
##                 2.5 %   97.5 %
## (Intercept) -2.006556 3.907963
## x1           2.171263 3.153688
## x2           2.525691 3.349940
koef<- as.matrix(reg$coefficients)
penduga <- cbind(b, koef)
colnames(penduga) <- c('matriks', 'fungsi lm')
rownames(penduga) <- c("intersep", "b1", "b2")
penduga
##            matriks fungsi lm
## intersep 0.9507033 0.9507033
## b1       2.6624755 2.6624755
## b2       2.9378152 2.9378152
#Model 1
a <- summary(reg)
rsquare1 <- a$r.squared
adj_r2 <- a$adj.r.squared
se1 <- a$sigma

#Model 2 (tanpa intersep)
reg2 <- lm(y~x1+x2-1, data=dt)
b <- summary(reg2)
rsquare2 <- b$r.squared
adj_r2_2 <- b$adj.r.squared
se2 <- b$sigma

#===Membandingkan kebaikan model===
model1 <- as.matrix(c(rsquare1, adj_r2, se1))
model2 <- as.matrix(c(rsquare2, adj_r2_2, se2))

tabel <- cbind(model1, model2)
colnames(tabel) <- c("Model 1", "Model 2")
rownames(tabel) <- c("R-Square", "Adj R-Square", "Standar Error Sisaan")
tabel
##                        Model 1   Model 2
## R-Square             0.8817384 0.9891749
## Adj R-Square         0.8767060 0.9887238
## Standar Error Sisaan 2.8996033 2.8819790