library(googlesheets4)
googlesheets4::gs4_deauth()
fdr <- read_sheet("12qQtaX-c8LB7ERZxSWGvp4b17qgGuG1qA1YzWf1FE1U")✔ Reading from "Dataset_FDR & SP_UAS".
✔ Range 'FDR'.
library(googlesheets4)
googlesheets4::gs4_deauth()
fdr <- read_sheet("12qQtaX-c8LB7ERZxSWGvp4b17qgGuG1qA1YzWf1FE1U")✔ Reading from "Dataset_FDR & SP_UAS".
✔ Range 'FDR'.
library(dplyr)
fdr <- fdr%>%mutate(Price=EPS*PER)
suppressWarnings(fdr$Aset <- as.double(fdr$Aset))
suppressWarnings(fdr$Liabilitas <- as.double(fdr$Liabilitas))
suppressWarnings(fdr$Ekuitas <- as.double(fdr$Ekuitas))
suppressWarnings(fdr$Pendapatan <- as.double(fdr$Pendapatan))
suppressWarnings(fdr$EBT <- as.double(fdr$EBT))
suppressWarnings(fdr$Profit <- as.double(fdr$Profit))
suppressWarnings(fdr$EPS <- as.double(fdr$EPS))
suppressWarnings(fdr$BVE <- as.double(fdr$BVE))
suppressWarnings(fdr$PBV <- as.double(fdr$PBV))
suppressWarnings(fdr$PER <- as.double(fdr$PER))
suppressWarnings(fdr$DER <- as.double(fdr$DER))
suppressWarnings(fdr$ROA <- as.double(fdr$ROA))
suppressWarnings(fdr$ROE <- as.double(fdr$ROE))
suppressWarnings(fdr$NPM <- as.double(fdr$NPM))
suppressWarnings(fdr$`Harga Saham` <- as.double(fdr$`Harga Saham`))colSums(is.na(fdr)) No. Sector Sub Industry Code Sub Industry
0 0 0 0
Code Stock Name Sharia FS Date
0 0 0 0
Fiscal Year End Type of FS Opini Auditor Aset
0 5 751 0
Liabilitas Ekuitas Pendapatan EBT
0 0 9 2
Profit Laba_Atribusi EPS BVE
0 0 6 0
PER PBV DER ROA
32 1 5 93
ROE NPM Harga Saham Individual Index
99 45 0 51
library(ggplot2)
ggplot(fdr,aes( PER + Pendapatan + Profit + EPS + PBV + ROA, `Harga Saham`)) + geom_point(aes(color = Sector)) + geom_smooth(method = "lm") + labs(title="Visualisasi Hubungan Variable Independent Terhadap Pergerakan Harga Saham")`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 123 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 123 rows containing missing values (`geom_point()`).
variable <- fdr[,c(27,15,17,19,21,22,23,24)]
library(corrplot)corrplot 0.92 loaded
cor.mtest(variable)$p
Harga Saham Pendapatan Profit EPS PER
Harga Saham 0.000000e+00 4.435627e-24 3.995042e-28 8.204224e-46 0.5470986
Pendapatan 4.435627e-24 0.000000e+00 8.659376e-184 6.735746e-04 0.7162817
Profit 3.995042e-28 8.659376e-184 0.000000e+00 6.581042e-05 0.7488920
EPS 8.204224e-46 6.735746e-04 6.581042e-05 0.000000e+00 0.8470218
PER 5.470986e-01 7.162817e-01 7.488920e-01 8.470218e-01 0.0000000
PBV 8.069473e-01 7.605020e-01 8.131298e-01 9.124051e-01 0.9865496
DER 7.609301e-01 7.685817e-01 8.177784e-01 9.129783e-01 0.7740362
ROA 7.165640e-01 4.449183e-02 8.093337e-01 8.991153e-01 0.9221361
PBV DER ROA
Harga Saham 0.8069473 0.7609301 0.71656395
Pendapatan 0.7605020 0.7685817 0.04449183
Profit 0.8131298 0.8177784 0.80933374
EPS 0.9124051 0.9129783 0.89911530
PER 0.9865496 0.7740362 0.92213606
PBV 0.0000000 0.0000000 0.96762022
DER 0.0000000 0.0000000 0.96319370
ROA 0.9676202 0.9631937 0.00000000
$lowCI
Harga Saham Pendapatan Profit EPS PER
Harga Saham 1.00000000 0.284738842 0.31222952 0.41652432 -0.04877434
Pendapatan 0.28473884 1.000000000 0.78009572 0.05126980 -0.08374702
Profit 0.31222952 0.780095720 1.00000000 0.07187174 -0.08176867
EPS 0.41652432 0.051269797 0.07187174 1.00000000 -0.07722751
PER -0.04877434 -0.083747020 -0.08176867 -0.07722751 1.00000000
PBV -0.07753388 -0.080097952 -0.07725454 -0.07309842 -0.06977528
DER -0.07982893 -0.079875075 -0.07723619 -0.07325594 -0.08085104
ROA -0.05973806 0.001872139 -0.06427937 -0.06854731 -0.07067432
PBV DER ROA
Harga Saham -0.07753388 -0.07982893 -0.059738063
Pendapatan -0.08009795 -0.07987507 0.001872139
Profit -0.07725454 -0.07723619 -0.064279365
EPS -0.07309842 -0.07325594 -0.068547307
PER -0.06977528 -0.08085104 -0.070674320
PBV 1.00000000 0.99626507 -0.071808188
DER 0.99626507 1.00000000 -0.071752028
ROA -0.07180819 -0.07175203 1.000000000
$uppCI
Harga Saham Pendapatan Profit EPS PER PBV
Harga Saham 1.00000000 0.40672642 0.43097008 0.52416813 0.09182642 0.06039591
Pendapatan 0.40672642 1.00000000 0.82885465 0.18841313 0.05762521 0.05860104
Profit 0.43097008 0.82885465 1.00000000 0.20752758 0.05887907 0.06067590
EPS 0.52416813 0.18841313 0.20752758 1.00000000 0.06343202 0.06535475
PER 0.09182642 0.05762521 0.05887907 0.06343202 1.00000000 0.07098159
PBV 0.06039591 0.05860104 0.06067590 0.06535475 0.07098159 1.00000000
DER 0.05843803 0.05908622 0.06103755 0.06554402 0.06025523 0.99716795
ROA 0.08677439 0.14840114 0.08224812 0.07798879 0.07806182 0.07483335
DER ROA
Harga Saham 0.05843803 0.08677439
Pendapatan 0.05908622 0.14840114
Profit 0.06103755 0.08224812
EPS 0.06554402 0.07798879
PER 0.06025523 0.07806182
PBV 0.99716795 0.07483335
DER 1.00000000 0.07519821
ROA 0.07519821 1.00000000
Urutan variabel dari yang memiliki korelasi tertinggi hingga terendah terhadap Harga Saham, berdasarkan matriks korelasi interval kepercayaan tinggi (uppCI):
EPS (Earnings Per Share): 0.52416813
Profit: 0.43097008
Pendapatan (Revenue): 0.40672642
PER (Price to Earnings Ratio): 0.09182642
ROA (Return on Assets): 0.08677439
PBV (Price to Book Value): 0.06039591
DER (Debt to Equity Ratio): 0.05843803
cor.test(fdr$`Harga Saham`,fdr$PER,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$PER
t = 0.60238, df = 775, p-value = 0.5471
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.04877434 0.09182642
sample estimates:
cor
0.021633
cor.test(fdr$`Harga Saham`,fdr$PBV,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$PBV
t = -0.24445, df = 806, p-value = 0.8069
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.07753388 0.06039591
sample estimates:
cor
-0.008609939
cor.test(fdr$`Harga Saham`,fdr$DER,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$DER
t = -0.30436, df = 802, p-value = 0.7609
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.07982893 0.05843803
sample estimates:
cor
-0.01074682
cor.test(fdr$`Harga Saham`,fdr$ROA,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$ROA
t = 0.3632, df = 714, p-value = 0.7166
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.05973806 0.08677439
sample estimates:
cor
0.01359111
cor.test(fdr$`Harga Saham`,fdr$ROE,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$ROE
t = 0.36922, df = 708, p-value = 0.7121
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.05976514 0.08736432
sample estimates:
cor
0.01387469
cor.test(fdr$`Harga Saham`,fdr$EPS,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$EPS
t = 15.157, df = 801, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.4165243 0.5241681
sample estimates:
cor
0.4721042
cor.test(fdr$`Harga Saham`,fdr$BVE,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$BVE
t = 9.1231, df = 807, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.2419406 0.3669621
sample estimates:
cor
0.3057688
cor.test(fdr$`Harga Saham`,fdr$NPM,method = "pearson")
Pearson's product-moment correlation
data: fdr$`Harga Saham` and fdr$NPM
t = 0.39748, df = 762, p-value = 0.6911
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.05658961 0.08523980
sample estimates:
cor
0.01439751
PBV (Price to Book Value): Tidak signifikan, p-value = 0.8069, correlation = -0.008609939.
DER (Debt to Equity Ratio): Tidak signifikan, p-value = 0.7609, correlation = -0.01074682.
ROA (Return on Assets): Tidak signifikan, p-value = 0.7166, correlation = 0.01359111.
ROE (Return on Equity): Tidak signifikan, p-value = 0.7121, correlation = 0.01387469.
EPS (Earnings Per Share): Sangat signifikan, p-value < 2.2e-16, correlation = 0.4721042.
BVE (Book Value of Equity): Sangat signifikan, p-value < 2.2e-16, correlation = 0.3057688.
NPM (Net Profit Margin): Tidak signifikan, p-value = 0.6911, correlation = 0.01439751.
library(moderndive)
regresi <- lm(`Harga Saham` ~ PER + Pendapatan + Profit + Aset + Liabilitas+ Ekuitas+ EPS + PBV + DER + ROA + ROE + NPM + BVE, data = fdr)
summary(regresi)
Call:
lm(formula = `Harga Saham` ~ PER + Pendapatan + Profit + Aset +
Liabilitas + Ekuitas + EPS + PBV + DER + ROA + ROE + NPM +
BVE, data = fdr)
Residuals:
Min 1Q Median 3Q Max
-14178 -1101 -827 -164 38182
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.188e+03 1.687e+02 7.043 4.92e-12 ***
PER 3.813e-01 4.174e-01 0.914 0.36132
Pendapatan 1.045e-01 3.167e-02 3.299 0.00103 **
Profit 5.175e-01 1.757e-01 2.945 0.00335 **
Aset -3.284e-03 1.621e-02 -0.203 0.83953
Liabilitas 9.383e-04 1.756e-02 0.053 0.95741
Ekuitas -3.131e-02 2.659e-02 -1.178 0.23939
EPS 3.742e+00 3.845e-01 9.733 < 2e-16 ***
PBV 2.793e+00 2.908e+00 0.961 0.33712
DER -6.157e+00 6.923e+00 -0.889 0.37414
ROA 1.302e+01 1.197e+01 1.088 0.27719
ROE 4.188e-01 7.919e-01 0.529 0.59708
NPM -4.585e-02 1.008e-01 -0.455 0.64946
BVE -3.849e-01 5.501e-02 -6.997 6.67e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3797 on 632 degrees of freedom
(163 observations deleted due to missingness)
Multiple R-squared: 0.4194, Adjusted R-squared: 0.4075
F-statistic: 35.12 on 13 and 632 DF, p-value: < 2.2e-16
plot(regresi)Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced
library(performance)
library(see)
check_model(regresi)regresi1 <- lm(`Harga Saham` ~ Pendapatan + Profit + EPS + BVE + PBV + ROE + ROA + DER + Ekuitas , data = fdr)Harga Saham = 1186.39+(0.118xPendapatan)+(0.504xProfit)+(3.761×EPS)−(0.387×BVE)+(3.485×PBV)+(0.526×ROE)+(10.628×ROA)−(7.634×DER)−(0.047×Ekuitas)
regresi2 <- lm(`Harga Saham` ~ PER + Pendapatan + Profit + EPS + PBV + ROA + BVE , data = fdr)Harga Saham = 1122+(0.489×PER)+(0.099×Pendapatan)+(0.161×Profit)+(4.08×EPS)−(0.022×PBV)+(5.49×ROA)−(0.43×BVE)
regresi3 <- lm(`Harga Saham` ~ Pendapatan + Profit + PBV + BVE , data = fdr)Harga Saham = 976.45+(0.0443×Pendapatan)+(0.559×Profit)−(0.01665×PBV)+(0.14114×BVE)
summary(regresi1)
Call:
lm(formula = `Harga Saham` ~ Pendapatan + Profit + EPS + BVE +
PBV + ROE + ROA + DER + Ekuitas, data = fdr)
Residuals:
Min 1Q Median 3Q Max
-14216 -1076 -836 -162 38380
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1186.38939 159.56536 7.435 3.26e-13 ***
Pendapatan 0.11796 0.02741 4.303 1.94e-05 ***
Profit 0.50370 0.17015 2.960 0.00318 **
EPS 3.76099 0.37316 10.079 < 2e-16 ***
BVE -0.38719 0.05341 -7.250 1.17e-12 ***
PBV 3.48527 2.77569 1.256 0.20969
ROE 0.52560 0.76931 0.683 0.49472
ROA 10.62803 10.44184 1.018 0.30913
DER -7.63375 6.64748 -1.148 0.25123
Ekuitas -0.04690 0.01672 -2.805 0.00517 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3725 on 660 degrees of freedom
(139 observations deleted due to missingness)
Multiple R-squared: 0.4185, Adjusted R-squared: 0.4106
F-statistic: 52.78 on 9 and 660 DF, p-value: < 2.2e-16
get_regression_table(regresi1)# A tibble: 10 × 7
term estimate std_error statistic p_value lower_ci upper_ci
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 intercept 1186. 160. 7.44 0 873. 1500.
2 Pendapatan 0.118 0.027 4.30 0 0.064 0.172
3 Profit 0.504 0.17 2.96 0.003 0.17 0.838
4 EPS 3.76 0.373 10.1 0 3.03 4.49
5 BVE -0.387 0.053 -7.25 0 -0.492 -0.282
6 PBV 3.48 2.78 1.26 0.21 -1.96 8.94
7 ROE 0.526 0.769 0.683 0.495 -0.985 2.04
8 ROA 10.6 10.4 1.02 0.309 -9.88 31.1
9 DER -7.63 6.65 -1.15 0.251 -20.7 5.42
10 Ekuitas -0.047 0.017 -2.80 0.005 -0.08 -0.014
summary(regresi2)
Call:
lm(formula = `Harga Saham` ~ PER + Pendapatan + Profit + EPS +
PBV + ROA + BVE, data = fdr)
Residuals:
Min 1Q Median 3Q Max
-14504 -1025 -832 -171 38405
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1121.81331 151.59904 7.400 4.05e-13 ***
PER 0.48926 0.39657 1.234 0.21773
Pendapatan 0.09865 0.02620 3.766 0.00018 ***
Profit 0.16114 0.11994 1.343 0.17957
EPS 4.07630 0.33167 12.290 < 2e-16 ***
PBV -0.02162 0.12440 -0.174 0.86210
ROA 5.49072 5.29226 1.037 0.29987
BVE -0.42998 0.04791 -8.975 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3724 on 678 degrees of freedom
(123 observations deleted due to missingness)
Multiple R-squared: 0.4044, Adjusted R-squared: 0.3982
F-statistic: 65.76 on 7 and 678 DF, p-value: < 2.2e-16
get_regression_table(regresi2)# A tibble: 8 × 7
term estimate std_error statistic p_value lower_ci upper_ci
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 intercept 1122. 152. 7.4 0 824. 1419.
2 PER 0.489 0.397 1.23 0.218 -0.289 1.27
3 Pendapatan 0.099 0.026 3.77 0 0.047 0.15
4 Profit 0.161 0.12 1.34 0.18 -0.074 0.397
5 EPS 4.08 0.332 12.3 0 3.42 4.73
6 PBV -0.022 0.124 -0.174 0.862 -0.266 0.223
7 ROA 5.49 5.29 1.04 0.3 -4.9 15.9
8 BVE -0.43 0.048 -8.98 0 -0.524 -0.336
summary(regresi3)
Call:
lm(formula = `Harga Saham` ~ Pendapatan + Profit + PBV + BVE,
data = fdr)
Residuals:
Min 1Q Median 3Q Max
-14896 -922 -796 -307 55169
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 976.44747 145.23229 6.723 3.39e-11 ***
Pendapatan 0.04429 0.02452 1.806 0.0713 .
Profit 0.55904 0.10614 5.267 1.79e-07 ***
PBV -0.01665 0.12950 -0.129 0.8977
BVE 0.14114 0.01260 11.203 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3878 on 794 degrees of freedom
(10 observations deleted due to missingness)
Multiple R-squared: 0.2619, Adjusted R-squared: 0.2582
F-statistic: 70.43 on 4 and 794 DF, p-value: < 2.2e-16
get_regression_table(regresi3)# A tibble: 5 × 7
term estimate std_error statistic p_value lower_ci upper_ci
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 intercept 976. 145. 6.72 0 691. 1262.
2 Pendapatan 0.044 0.025 1.81 0.071 -0.004 0.092
3 Profit 0.559 0.106 5.27 0 0.351 0.767
4 PBV -0.017 0.13 -0.129 0.898 -0.271 0.238
5 BVE 0.141 0.013 11.2 0 0.116 0.166
Untuk menemukan Model Regresi yang Valid dibutuhkan nilai Ajusted R-Squared lebih dari 70% Namun setelah sekian banyak percobaan trial and error dengan cara menambah maupun mengurangi variable independent, ternyata dapat diketahui bahwa terdapat beberapa variable independent yang bisa menambah secara signifikan nilai Ajusted R-Squared seperti EPS, BVE, Profit, Pendapatan tetapi ada juga variable yang tidak mempengaruhi (tidak naik/turun) seperti liabilitas. Dan ada juga penambahan variable independent justru berefek sebaliknya yaitu mengurangi nilai Ajusted R-Squared contohnya seperti NPM, DER, PER. Dari Ketiga Model Regresi tersebut, yang memiliki R Squared tertinggi adalah Model Regresi 1 dengan nilai sebesar 41,06% atau kemampuan prediksi model yang telah dibuat hanya sebesar 41,06%.
Urutan variable independent yang memiliki nilai prediksi yang paling besar terhadap Harga Saham adalah Earning per share (EPS) dengan koefisien estimasi sebesar 3.760 selanjutnya variable independent lain yang juga memiliki nilai pengaruh prediksi yang besar adalah Pendapatan, Profit, BVE, dan Ekuitas.