0% found this document useful (0 votes)
66 views6 pages

Praktikum Analisis Data Eksplorasi

This document discusses analyzing exploratory data in R. It contains 3 questions and their answers. Question 1 involves coding to change values in a matrix. Question 2 asks to identify as many mathematical functions in R as possible and provides examples. Question 3 discusses the formulas for simple and multiple linear regression, including the correlation coefficient formula and formulas for the intercept (a) and slope (b) terms.

Uploaded by

laode ikbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views6 pages

Praktikum Analisis Data Eksplorasi

This document discusses analyzing exploratory data in R. It contains 3 questions and their answers. Question 1 involves coding to change values in a matrix. Question 2 asks to identify as many mathematical functions in R as possible and provides examples. Question 3 discusses the formulas for simple and multiple linear regression, including the correlation coefficient formula and formulas for the intercept (a) and slope (b) terms.

Uploaded by

laode ikbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Tugas Pendahuluan 7

PRAKTIKUM
ANALISIS DATA EKSPLORASI

OLEH
NAMA : RATI ASSYIFA PUTRI
NIM : F1F1 17 051
KELOMPOK : I (SATU)

PROGRAM STUDI S1 STATISTIKA


JURUSAN MATEMATIKA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITTAS HALU OLEO
KENDARI
2018
Soal :

1. Coding :

A1 A2 A3
A1 1 2 3
A2 4 5 6
A3 7 8 9

a. Ubahlah angka 5, 6 dan 9 menjadi angka 0!


b. Ubahlah angka 1, 2 dan 3 menjadi 1!
c. Ubahlah angka 5,7 dan 8 menjadi 3 !
2. Carilah fungsi matematika dalam R sebanyak-banyaknya!
3. Carilah rumus analisis regresi linear sederhana dan berganda!

Jawaban :

1. a. Coding :

> sr[c(2,3),c(2,3)]='0'
> sr
A1 A2 A3
A1 1 2 3
A2 4 0 0
A3 7 0 0
> sr[c(3),2]='8'
> sr
A1 A2 A3
A1 1 2 3
A2 4 0 0
A3 7 8 0

b. Coding :

> sr[(1),]='1'
> sr
A1 A2 A3
A1 1 1 1
A2 4 0 0
A3 7 8 0

c. Coding :

> sr[c(2,3),c(2,1)]='3'
> sr
A1 A2 A3
A1 1 2 3
A2 3 3 0
A3 3 3 0
> sr[c(3),2]='4'
> sr
A1 A2 A3
A1 1 2 3
A2 4 3 0
A3 3 3 0

2. Fungsi matematika dalam R

No. Fungsi Deskripsi


1. Sqrt Akar Kuadrat
2. Cos Cosinus
3. Sin Sinus
4. Tan Tangen
5. Log Logaritma
6. Min Nilai terkecil
7. Mean Rata-Rata
8. Var Ragam
9. Sum Jumlah total elemen vektor
10. Exp Exponential
11. Max Nilai Terbesar
12. Median Nilai tengah
13. Sd Standar deviasi
14. Length Banyaknya data
15 Cor korelasi
16. Lm Regresi linear
17. Unique -
18. Range Jarak
19. stem -
20. Summary -
21. svd -
22. [Link] -
23. [Link] Uji t
24 [Link] -
25. [Link] -
26. [Link] -
27. hist Histogram
28. pie Pie-chart
29. boxplot Boxplot
30. plot Plot

Coding :

> x=c(1,3,7,8)
> x
[1] 1 3 7 8
> sum(x)
[1] 19
> mean (x)
[1] 4.75
> sin(x)
[1] 0.8414710 0.1411200 0.6569866 0.9893582
> cos(x)
[1] 0.5403023 -0.9899925 0.7539023 -0.1455000
> log(x)
[1] 0.000000 1.098612 1.945910 2.079442
> median(x)
[1] 5
> sqrt(x)
[1] 1.000000 1.732051 2.645751 2.828427
> tan(x)
[1] 1.5574077 -0.1425465 0.8714480 -6.7997115
> exp(x)
[1] 2.718282 20.085537 1096.633158 2980.957987
> var(x)
[1] 8.2
> min(x)
[1] 1
> max(x)
[1] 8
> x=c(3,6,9,4,8)
> x
[1] 3 6 9 4 8
> length(x)
[1] 5
> sd(x)
[1] 2.54951
> y=c(2,7,8,5,9)
> cor(x,y)
[1] 0.9187795
> x=c(3,6,9,4,8)
> y=c(2,7,8,5,9)
> matrix(c(sr),5,5)
[,1] [,2] [,3] [,4] [,5]
[1,] 6 6 6 6 6
[2,] 42 42 42 42 42
[3,] 72 72 72 72 72
[4,] 20 20 20 20 20
[5,] 72 72 72 72 72
> unique(sr)
[1] 6 42 72 20
> range(sr)
[1] 6 72
> stem(x)

The decimal point is at the |

2 | 0
4 | 0
6 | 0
8 | 00
> vec=c(x)
> vec
[1] 3 6 9 4 8
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
3 4 6 6 8 9
> [Link](x,x)

Welch Two Sample t-test

data: x and x
t = 0, df = 8, p-value = 1
alternative hypothesis: true difference in means is not
equal to 0
95 percent confidence interval:
-3.71832 3.71832
sample estimates:
mean of x mean of y
6 6

3. Rumus untuk koefisien korelasi adalah sebagai berikut

N  XY  ( X )( Y )
r
N  X 2  ( X )  N  Y 2  ( Y ) 2

Persamaan regresi linear sederhana sebagai berikut.

y= a + bx

Persamaan regresi linear berganda sebagai berikut:

Y’ = a + b1X1+ b2X2+…..+ bnXn


Dan rumus untuk mendapatkan nilai a adalah sebagai berikut :

N Y X
a b
N N

Y adalah variabel tak bebas, a adalah koefisien intersep, b adalah


kemiringan dan t adalah variabel bebas. Rumus untuk b adalah :

N  XY  ( X )( Y )
b
N  X 2  ( X ) 2

You might also like