Академический Документы
Профессиональный Документы
Культура Документы
table("clipboard",header=T)
> a
himpunan nilai
1 x 18
2 x 9
3 x 16
4 x 20
5 x 15
6 x 12
7 y 6
8 y 14
9 y 13
10 y 8
11 y 9
12 y 8
13 y 12
> b=read.table("D;/acara9.txt",header=T)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'D;/acara9.txt': No such file or directory
> b=read.table("D;/acara9.txt",header=T)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'D;/acara9.txt': No such file or directory
> b=read.table("D:/acara9.txt",header=T)
> b
himpunan nilai
1 x 18
2 x 9
3 x 16
4 x 20
5 x 15
6 x 12
7 y 6
8 y 14
9 y 13
10 y 8
11 y 9
12 y 8
13 y 12
> t.test(a$nilai~a$himpunan,var.equal=T,alternative=c("greater"),data=a)
> b=read.table("D:/acara92.txt",header=T)
> b
dam hasil
1 sebelum 10
2 sebelum 3
3 sebelum 4
4 sebelum 7
5 sebelum 8
6 sebelum 5
7 sebelum 8
8 sebelum 4
9 sebelum 5
10 sesudah 11
11 sesudah 15
12 sesudah 18
13 sesudah 17
14 sesudah 11
15 sesudah 9
16 sesudah 4
17 sesudah 15
18 sesudah 8
> t.test(b$hasil~b$dam,paired=T,alternative=c("less"),data=b)
Paired t-test
Paired t-test
> save.image("C:\\Users\\N_dip\\Documents\\acara9.RData")
> #Keismpulan Ho diterima
> e=read.table("clipboard",header=T)
> e
y x
1 13 6
2 5 1
3 7 3
4 12 6
5 10 6
6 7 0
7 6 6
8 6 10
9 5 0
10 13 6
11 4 1
> cor.test(e$x,e$y,method="pearson")
> #Kesimpulan Keeratan sebesar 48% dan sisanya dipengaruhi faktor-faktor lain
> reg=lm(y~x,data=e)
> summary(reg)
Call:
lm(formula = y ~ x, data = e)
Residuals:
Min 1Q Median 3Q Max
-4.985 -1.939 -0.449 2.051 4.036
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.9337 1.5442 3.843 0.00395 **
x 0.5051 0.3002 1.682 0.12678
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1