Business Case yang ingin dijawab adalah Bagaimana kita dapat memprediksi nilai Sulphide Sulfur
Load data intercept (hanya data ore) yang memiliki irisan antara Total Sulphur, Sulphide Megaskopis dan Nilai Sulphide Sulphur
ss<-read.csv("Data Input/AllZone_database_Resume_Rstudio_081019_R1.csv")
ss_z1<-ss[ss$Zone=="Z1",c(1,5,8,9,16,18,19,21,23)]
ss_z2<-ss[ss$Zone=="Z2",c(1,5,8,9,16,18,19,21,23)]
ss_z3<-ss[ss$Zone=="Z3",c(1,5,8,9,16,18,19,21,23)]
ss_z4<-ss[ss$Zone=="Z4",c(1,5,8,9,16,18,19,21,23)]
ss_z68<-ss[ss$Zone=="Z68",c(1,5,8,9,16,18,19,21,23)]
head(ss,10)## Rows: 93
## Columns: 25
## $ Zone <chr> "Z1", "Z1", "Z1", "Z1", "Z2", "Z2", "Z2", "Z2", "Z2", "Z2~
## $ holeid <chr> "PDH294", "PDH309", "PDH309", "PDH309", "PDH299", "PDH299~
## $ from <dbl> 53.90, 46.80, 48.10, 63.35, 25.90, 27.10, 26.50, 61.75, 1~
## $ to <dbl> 54.90, 47.60, 49.10, 66.35, 27.10, 28.40, 27.50, 62.45, 1~
## $ Cu_pc <dbl> 0.97200, 0.00740, 0.00850, 0.01150, 0.02840, 0.05590, 0.0~
## $ Cu_ppm <dbl> 9720.0, 74.0, 85.0, 115.0, 284.0, 559.0, 90.0, 1070.0, 64~
## $ INTERCEPT_AU <chr> "125", "125", "125", "120", "22", "22", "22", "23", "23",~
## $ Agppm <dbl> 27.0, 10.0, 8.0, 0.5, 22.0, 98.0, 3.0, 80.0, 35.0, 62.0, ~
## $ Auppm <dbl> 5.020, 0.590, 0.700, 0.740, 0.540, 1.480, 0.745, 0.920, 0~
## $ ALT <chr> "SIL", "PRO", "PRO", "PRO", "SIL", "SIL", "IAR", "SIL", "~
## $ ALT_CODE <int> 1, 5, 5, 5, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1, ~
## $ INTERVAL <dbl> 6.50, 1.80, 1.00, 13.25, 2.50, 2.50, 1.00, 0.70, 10.80, 1~
## $ OXDOM <chr> "High Sulphide", "Low Sulphide", "Low Sulphide", "Low Sul~
## $ S2S_Charc <chr> "High Sulphide", "High Sulphide", "High Sulphide", "Low S~
## $ Sample_ID <chr> "DC-022401-Z1", "DC-023007-Z1", "DC-023009-Z1", "DC-02301~
## $ AuCn_Meta <dbl> 2.170, 0.170, 0.005, 0.005, 0.360, 1.020, 0.005, 0.430, 0~
## $ INTERVAL_2 <dbl> 1.0, 0.8, 1.0, 3.0, 1.2, 1.3, 1.0, 0.7, 2.0, 1.2, 1.0, 1.~
## $ S2S <dbl> 3.91, 2.31, 2.59, 1.07, 3.15, 3.48, 2.27, 2.83, 1.36, 3.7~
## $ S_pc_Meta <dbl> 4.14, 2.33, 2.61, 1.15, 3.27, 3.59, 2.33, 2.90, 1.38, 3.8~
## $ INTERVAL_3 <dbl> 1.0, 0.8, 1.0, 3.0, 1.2, 1.3, 1.0, 0.7, 2.0, 1.2, 1.0, 1.~
## $ SULPHIDE <dbl> 5.8, 0.3, 0.4, 0.3, 4.0, 4.0, 1.0, 1.5, 1.3, 2.2, 1.9, 1.~
## $ Interval_4 <dbl> 1.0, 0.8, 1.0, 3.0, 1.2, 1.3, 1.0, 0.7, 2.0, 1.2, 1.0, 1.~
## $ S_pc_Expl <dbl> 3.80, 2.25, 2.53, 1.10, 3.00, 3.61, 2.10, 2.86, 1.41, 3.9~
## $ Sppm <int> 38000, 22500, 25300, 11000, 30000, 36100, 21000, 28600, 1~
## $ Rec_Indic <dbl> 0.43, 0.29, 0.01, 0.01, 0.67, 0.69, 0.01, 0.47, 0.90, 0.5~
ss_clean <- ss %>%
mutate_at(vars(Zone,S2S_Charc),as.factor) %>%
select(c(Zone,S2S_Charc,S2S,S_pc_Meta,S_pc_Expl,Cu_pc,Rec_Indic))Zone,S2S_Charc menjadi factorZone,S2S_Charc,S2S,S_pc_Meta,S_pc_Expl,Cu_pc,Rec_Indic## Zone S2S_Charc S2S S_pc_Meta S_pc_Expl Cu_pc Rec_Indic
## 0 0 0 0 0 0 0
Tidak terdapat missing value
Melihat korelasi antar variable, dan hasilnya : - S2S berkorelasi sangat kuat dengan
S_pc_Meta dan S-pc_Expl
##
## Call:
## lm(formula = S2S ~ S_pc_Meta + S_pc_Expl, data = ss_clean)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.38296 -0.01228 0.02907 0.06260 0.08255
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.08189 0.01677 -4.882 4.53e-06 ***
## S_pc_Meta 1.03763 0.03803 27.281 < 2e-16 ***
## S_pc_Expl -0.04263 0.03928 -1.085 0.281
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1006 on 90 degrees of freedom
## Multiple R-squared: 0.996, Adjusted R-squared: 0.9959
## F-statistic: 1.11e+04 on 2 and 90 DF, p-value: < 2.2e-16
Model ini menggunakan variable dengan korelasi kuat terhadap target, yaitu : - S_pc_Meta - S_pc_Expl
## 1 2 3 4 5 6
## 4.051908 2.239874 2.518474 1.064495 3.183274 3.489311
##
## Call:
## lm(formula = S2S ~ S_pc_Meta + S_pc_Expl, data = ss_clean)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.38296 -0.01228 0.02907 0.06260 0.08255
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.08189 0.01677 -4.882 4.53e-06 ***
## S_pc_Meta 1.03763 0.03803 27.281 < 2e-16 ***
## S_pc_Expl -0.04263 0.03928 -1.085 0.281
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1006 on 90 degrees of freedom
## Multiple R-squared: 0.996, Adjusted R-squared: 0.9959
## F-statistic: 1.11e+04 on 2 and 90 DF, p-value: < 2.2e-16
R-squared = 0.996
-Linearity
Variabel predictor linear terhadap target
##
## Shapiro-Wilk normality test
##
## data: model_ss$residuals
## W = 0.69922, p-value = 1.653e-12
karena p-value (1.65 x 10e-12) < alpha (0.05), maka tolak H0 Residual tidak berdistribusi Normal
-Homosdescity
##
## studentized Breusch-Pagan test
##
## data: model_ss
## BP = 6.1597, df = 2, p-value = 0.04597
karena p-value (0.045) < alpha (0.05), maka tolak H0 Tidak memenuhi asumsi Homosdescity
## S_pc_Meta S_pc_Expl
## 32.30393 32.30393
karena vif > 10, variabel predictor saling berkorelasi Tidak memenuhi asumsi No Multicolinierity
##
## Call:
## lm(formula = S2S ~ S_pc_Meta + S_pc_Expl, data = ss_clean)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.38296 -0.01228 0.02907 0.06260 0.08255
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.08189 0.01677 -4.882 4.53e-06 ***
## S_pc_Meta 1.03763 0.03803 27.281 < 2e-16 ***
## S_pc_Expl -0.04263 0.03928 -1.085 0.281
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1006 on 90 degrees of freedom
## Multiple R-squared: 0.996, Adjusted R-squared: 0.9959
## F-statistic: 1.11e+04 on 2 and 90 DF, p-value: < 2.2e-16
ModelRegresi = -0.08189 + 1.03763 * S_pc_Meta - 0.04263 * S_pc_Expl a. Model regesi yang diperoleh:
s2s = -0.08189 + 1.03763 * S_pc_Meta - 0.04263 * S_pc_Expl
S_pc_Meta dan S_pc_Expl = 0, s2s yang diperoleh adalah -0.08189Tolak H0 jika p-value < alpha (5%). Berdasarkan output di atas diperoleh p-value (<0.0000000000000002), sehingga dapat disimpulkan bahwa S_pc_Meta signifikan memepengaruhi s2s
multiple R-Squared = 0.996, S_pc_Meta dapat menggambarkan/mendeskripsikan s2s sebesar 99.6%