==============================================================================================================

TUGAS BISNIS ANALITIK

Lakukan analisis statistik menggunakan RMarkdown meliputi :

  1. Statistika deskriptif

  2. Visualisasi data (histogram, scatterplot, dan lain-lain)

  3. Analisis korelasi

  4. Model regresi linier

Analisis statistika ini dilakukan dengan menggunakan data longley yang terdiri dari 7 variabel ekonomi yang terdiri dari 1 variabel respon dan 6 variabel prediktor. Observasi ini dilakukan sebanyak 16 kali yaitu dari tahun 1947 sampai 1962. Informasi lebih lanjut mengenai variabel dan data longley akan ditampilkan sebagai berikut.

VARIABEL LONGLEY

Variabel Nama Variabel
X1 GNP.deflator
X2 GNP
X3 Unemployed
X4 Armed.Forces
X5 Population
X6 Year
Y Employed

DATA LONGLEY

GNP.deflator GNP Unemployed Armed.Forces Population Year Employed
83 234.289 235.6 159 107.608 1947 60.323
88.5 259.426 232.5 145.6 108.632 1948 61.122
88.2 258.054 368.2 161.6 109.773 1949 60.171
89.5 284.599 335.1 165 110.929 1950 61.187
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
116.9 554.894 400.7 282.7 130.081 1962 70.551

1. Analisis Deskriptif

##   GNP.deflator         GNP          Unemployed     Armed.Forces  
##  Min.   : 83.00   Min.   :234.3   Min.   :187.0   Min.   :145.6  
##  1st Qu.: 94.53   1st Qu.:317.9   1st Qu.:234.8   1st Qu.:229.8  
##  Median :100.60   Median :381.4   Median :314.4   Median :271.8  
##  Mean   :101.68   Mean   :387.7   Mean   :319.3   Mean   :260.7  
##  3rd Qu.:111.25   3rd Qu.:454.1   3rd Qu.:384.2   3rd Qu.:306.1  
##  Max.   :116.90   Max.   :554.9   Max.   :480.6   Max.   :359.4  
##    Population         Year         Employed    
##  Min.   :107.6   Min.   :1947   Min.   :60.17  
##  1st Qu.:111.8   1st Qu.:1951   1st Qu.:62.71  
##  Median :116.8   Median :1954   Median :65.50  
##  Mean   :117.4   Mean   :1954   Mean   :65.32  
##  3rd Qu.:122.3   3rd Qu.:1958   3rd Qu.:68.29  
##  Max.   :130.1   Max.   :1962   Max.   :70.55

2. Visualisasi Data

boxplot

scatterplot

histogram

3.Analisis Korelasi

##              GNP.deflator       GNP Unemployed Armed.Forces Population
## GNP.deflator    1.0000000 0.9915892  0.6206334    0.4647442  0.9791634
## GNP             0.9915892 1.0000000  0.6042609    0.4464368  0.9910901
## Unemployed      0.6206334 0.6042609  1.0000000   -0.1774206  0.6865515
## Armed.Forces    0.4647442 0.4464368 -0.1774206    1.0000000  0.3644163
## Population      0.9791634 0.9910901  0.6865515    0.3644163  1.0000000
## Year            0.9911492 0.9952735  0.6682566    0.4172451  0.9939528
## Employed        0.9708985 0.9835516  0.5024981    0.4573074  0.9603906
##                   Year  Employed
## GNP.deflator 0.9911492 0.9708985
## GNP          0.9952735 0.9835516
## Unemployed   0.6682566 0.5024981
## Armed.Forces 0.4172451 0.4573074
## Population   0.9939528 0.9603906
## Year         1.0000000 0.9713295
## Employed     0.9713295 1.0000000

Pengujian korelasi dapat dilakukan dengan syntax, sebagai contoh dilakukan pengujian korelasi antara “employed” dan “GNP.deflator”. Output akan ditampilkan sebagai berikut.

cor.test(longley$Employed,longley$GNP.deflator)
## 
##  Pearson's product-moment correlation
## 
## data:  longley$Employed and longley$GNP.deflator
## t = 15.169, df = 14, p-value = 4.389e-10
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.9160873 0.9900925
## sample estimates:
##       cor 
## 0.9708985

4. Analisis Regresi

## 
## Call:
## lm(formula = Employed ~ GNP.deflator + GNP + Unemployed + Armed.Forces + 
##     Population + Year, data = longley)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.41011 -0.15767 -0.02816  0.10155  0.45539 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -3.482e+03  8.904e+02  -3.911 0.003560 ** 
## GNP.deflator  1.506e-02  8.492e-02   0.177 0.863141    
## GNP          -3.582e-02  3.349e-02  -1.070 0.312681    
## Unemployed   -2.020e-02  4.884e-03  -4.136 0.002535 ** 
## Armed.Forces -1.033e-02  2.143e-03  -4.822 0.000944 ***
## Population   -5.110e-02  2.261e-01  -0.226 0.826212    
## Year          1.829e+00  4.555e-01   4.016 0.003037 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3049 on 9 degrees of freedom
## Multiple R-squared:  0.9955, Adjusted R-squared:  0.9925 
## F-statistic: 330.3 on 6 and 9 DF,  p-value: 4.984e-10

Model regresi linier berganda yang diperoleh yaitu

Employed = -3.482e+03 + 1.506e-02 GNP.deflator -3.582e-02GNP-2.020e-02Unemployed-1.033e-02Armed.Forces-5.110e-02Population+1.829Year

Nilai R-Sq sebesar 0.995 yang menunjukkan bahwa variabel prediktor dapat menjelaskan variabel respon sebesar 99.5%