Ini dia coding laporan akhir beserta gambar-gambarnya. haha. maaf ya, agak berantakan. gue ga bakal sempet ngerapihin soalnya. good luck ya buat ujian besok. :)
> data = c(41, 45, 49, 51, 52, 53, 55, 56, 63, 57, 57, 58, 59, 60, 61, 67, 62, 59, 63, 35, 65, 65, 65, 67, 67, 73, 61, 69, 69, 96, 69, 70, 71, 71, 77, 79, 73, 93, 73, 81, 75, 75, 77, 77, 89, 67, 79, 79, 79, 81, 59, 83, 83, 87, 89, 71, 92, 81, 65, 64)
> length(data)
[1] 60
> sort(data)
[1] 35 41 45 49 51 52 53 55 56 57 57 58 59 59 59 60 61 61 62 63 63 64 65 65 65 65 67 67 67 67 69 69 69 70 71 71 71 73 73 73 75 75 77 77 77 79 79 79 79 81
[51] 81 81 83 83 87 89 89 92 93 96
> max(data)
[1] 96
> min(data)
[1] 35
> jlhkls=1+(3.322*log10(length(data)))
> jlhkls
[1] 6.907018
> round (jlhkls)
[1] 7
> jangk=(max(data)-min(data))
> jangk
[1] 61
> int=(jangk/jlhkls)
> int
[1] 8.831596
> round (int)
[1] 9
> frek=function(x,y,z)
+ {
+ a=0
+ for (i in 1:length(x))
+ {
+ if(x[i]>=y&&x[i]<=z) + { + a=a+1 + print(a) + } + } + } > frek
function(x,y,z)
{
a=0
for (i in 1:length(x))
{
if(x[i]>=y&&x[i]<=z) { a=a+1 print(a) } } } > frek
function(x,y,z)
{
a=0
for (i in 1:length(x))
{
if(x[i]>=y&&x[i]<=z) { a=a+1 print(a) } } } > tabel=edit(data.frame())
> tabel
kelas
1 35-43
2 44-52
3 53-61
4 62-70
5 71-79
6 80-88
7 89-97
> frek(data,35,43)
[1] 1
[1] 2
> frek(data,44,52)
[1] 1
[1] 2
[1] 3
[1] 4
> frek(data,53,61)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
> frek(data,62,70)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
> frek(data,71,79)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
> frek(data,80,88)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
> frek(data,89,97)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
> tabel=edit(data.frame())
> 4
[1] 4
> tabel
kelas frek
1 35-43 2
2 44-52 4
3 53-61 12
4 62-70 16
5 71-79 15
6 80-88 6
7 89-97 5
> tabel
kelas frek
1 35-43 2
2 44-52 4
3 53-61 12
4 62-70 16
5 71-79 15
6 80-88 6
7 89-97 5
> tabel
kelas frek
1 35-43 2
2 44-52 4
3 53-61 12
4 62-70 16
5 71-79 15
6 80-88 6
7 89-97 5
> mean (35:43)
[1] 39
> mean (44:52)
[1] 48
> mean (53:61)
[1] 57
> mean (62:70)\
Error: syntax error
> mean (62:70)
[1] 66
> mean (71:79)
[1] 75
> mean (80:88)
[1] 84
> mean (89:97)
[1] 93
> fi=(2,4,12,16,15,6,5)
Error: syntax error
> fi=c(2,4,12,16,15,6,5)
> fi
[1] 2 4 12 16 15 6 5
> ttktengah=c(39,48,57,66,75,84,93)
> ttktengah
[1] 39 48 57 66 75 84 93
> mean=(sum(fr*ttktengah))/60
Error in sum(fr * ttktengah) : Object "fr" not found
> mean=(sum(fi*ttktengah))/60
> mean
[1] 68.4
> round (mean
+ )
[1] 68
> median=(sum(sort(data)))
> median
[1] 4109
> median=(sum(sort(data)))/60
> median
[1] 68.48333
> round (median)
[1] 68
> median=61,5+int*((30-18)/15)
Error: syntax error
> median=61,5(+int*((30-18)/15))
Error: syntax error
> int
[1] 8.831596
> round (int)
[1] 9
> median=61,5(+int*((30-18)/15))
Error: syntax error
> median=61,5+(int*((30-18)/15))
Error: syntax error
> median=61,5+(9*((30-18)/15))
Error: syntax error
> tbm=62-0.5
> tbm
[1] 61.5
> fkm=18
> fkm
[1] 18
> fm=15
> fm
[1] 15
> km=60/2
> km
[1] 30
> i=9
> i
[1] 9
> median=tbm+i*((km-fkm)/fm)
> meadian
Error: Object "meadian" not found
> median
[1] 68.7
> d1=16-12
> d1
[1] 4
> d2=16-15
> d2
[1] 1
> modus=tbm+i*(d1/(d1+d2))
> modus
[1] 68.7
> bq1=52.5
> bq1
[1] 52.5
> fkq1=6
> fkq1
[1] 6
> km1=60/4
> km1
[1] 15
> fq1=12
> fq1
[1] 12
> q1=bq1+i*((km1-fkq1)/fq1)
> q1
[1] 59.25
> bq2=61,5
Error: syntax error
> bq2=61.5
> bq2
[1] 61.5
> fkq2=18
> fkq2
[1] 18
> km2=30
> km2
[1] 30
> fq2=16
> fq2
[1] 16
> q2=(bq2+i*((km2-fkq2)/fq2)
+ q2=bq2+i*((km2-fkq2)/fq2)
Error: syntax error
> q2=bq2+i*((km2-fkq2)/fq2)
> q2
[1] 68.25
> bq3=70.5
> bq3
[1] 70.5
> fkq3=34
> fkq3
[1] 34
> km3=45
> km3
[1] 45
> fq3=15
> fq3
[1] 15
> q2=bq3+i*((km3-fkq3)/fq3)
> q2
[1] 77.1
> q3=bq3+i*((km3-fkq3)/fq3)
> q3
[1] 77.1
>
No comments:
Post a Comment