Berlian Mumtaj
rnorm(80, 5, 2)
## [1] 5.39006323 4.41246414 6.23980257 6.75590915 7.01920632 5.39597574
## [7] 8.93112797 4.87382428 3.93465674 4.85791495 5.46148572 5.65500096
## [13] 6.81023437 4.47312806 3.51456056 5.67075035 3.74500814 5.17512817
## [19] 3.97960672 3.15497749 7.50578065 1.91879929 7.23664830 7.67953812
## [25] 2.44566828 5.02616151 3.45544690 2.87421971 8.10169144 3.04721520
## [31] 7.24279277 3.05242254 6.61237246 3.25119626 3.58686389 4.91688870
## [37] 4.29414267 7.70126513 5.81244177 7.16899693 5.97209057 3.14582514
## [43] 4.00660742 5.82132154 3.63487660 4.92642584 1.59000779 8.11073072
## [49] 3.37882796 6.08278798 4.21996200 4.77760967 4.04746655 5.42535843
## [55] 4.75830235 6.83856052 4.00947651 7.45383110 3.83422481 0.04804808
## [61] 3.83878308 7.97487189 3.56713538 8.05984042 8.53484789 3.62606575
## [67] 8.31429834 2.60865046 4.15953567 2.15743131 8.08601346 3.34573616
## [73] 3.01876575 8.03457663 4.40055213 6.39365488 4.23359293 3.21031156
## [79] 2.67965298 6.26745979
investment <- c(200,220,230,240,260,280,300,310,320)
investment <- c(50,55,60,65,70,75,80,85,90.95)
output <- c(200,220,230,240,260,280,300,310,320)
investment
## [1] 50.00 55.00 60.00 65.00 70.00 75.00 80.00 85.00 90.95
data <- data.frame(investment, output)
data
## investment output
## 1 50.00 200
## 2 55.00 220
## 3 60.00 230
## 4 65.00 240
## 5 70.00 260
## 6 75.00 280
## 7 80.00 300
## 8 85.00 310
## 9 90.95 320
#regresi linear
model <- lm(output ~ investment, data=data)
model
##
## Call:
## lm(formula = output ~ investment, data = data)
##
## Coefficients:
## (Intercept) investment
## 47.874 3.058
plot(data$investment, data$output,
xlab = "Investment (Juta Dolar)",
ylab = "Output (Juta Unit)",
main = "Regresi Linear antara investasi dan output industri")
abline(model, col="pink", lwd=2)