Вы находитесь на странице: 1из 12

> crd=read.table("D:/R/CRD.

txt",header=T)
> crd
perlakuan hasil
1
A 6.0
2
A 7.0
3
A 2.0
4
A 7.0
5
A 3.0
6
A 9.0
7
A 1.0
8
B 9.0
9
B 26.0
10
B 12.0
11
B 22.0
12
B 16.0
13
C 23.0
14
C 6.0
15
C 20.0
16
C 10.0
17
C 16.0
18
C 22.0
19
C 8.0
20
D 9.5
21
D 3.5
22
D 9.0
23
D 2.5
24
D 9.5
25
D 4.0
26
D 10.0
27
D 3.0
28
D 6.5
29
D 7.5
>
> library(agricolae)
> attach(crd)
> tapply(X=hasil,INDEX=list(perlakuan),FUN=mean)
A B C D
5.0 17.0 15.0 6.5
> detach(crd)
> library(agricolae)
> attach(crd)
> fisher<-aov(hasil~perlakuan,data=crd)
> fisher
Call:
aov(formula = hasil ~ perlakuan, data = crd)
Terms:
perlakuan Residuals
Sum of Squares
717.5
625.0
Deg. of Freedom
3
25
Residual standard error: 5
Estimated effects may be unbalanced
> summary(fisher)

Df Sum Sq Mean Sq F value Pr(>F)


perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> lsd<-LSD.test(hasil,perlakuan,dfError,MSError,p.adj="none",alpha=0.05)
Error in LSD.test(hasil, perlakuan, dfError, MSError, p.adj = "none", :
object 'MSError' not found
> lsd<-LSD.test(hasil,perlakuan,25,25,p.adj="none",alpha=0.05)
> lsd
$statistics
Mean CV MSerror
10 50
25
$parameters
Df ntr t.value
25 4 2.059539
$means
hasil std r
LCL
UCL Min Max
A 5.0 3 7 1.107838 8.892162 1.0 9
B 17.0 7 5 12.394732 21.605268 9.0 26
C 15.0 7 7 11.107838 18.892162 6.0 23
D 6.5 3 10 3.243584 9.756416 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
> bfrn<-aov(hasil~perlakuan,data=crd)
> bfrn
Call:
aov(formula = hasil ~ perlakuan, data = crd)
Terms:
perlakuan Residuals
Sum of Squares
717.5
625.0
Deg. of Freedom
3
25
Residual standard error: 5
Estimated effects may be unbalanced
> summary(bfrn)

Df Sum Sq Mean Sq F value Pr(>F)


perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> uji<-LSD.test(hasil,perlakuan,25,25,p.adj="bonferroni",alpha=0.05)
> uji
$statistics
Mean CV MSerror
10 50
25
$parameters
Df ntr bonferroni
25 4 2.864886
$means
hasil std r
LCL
UCL Min Max
A 5.0 3 7 1.107838 8.892162 1.0 9
B 17.0 7 5 12.394732 21.605268 9.0 26
C 15.0 7 7 11.107838 18.892162 6.0 23
D 6.5 3 10 3.243584 9.756416 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> library(multcomp)
Loading required package: mvtnorm
Loading required package: survival
Loading required package: splines
Loading required package: TH.data
> attach(crd)
The following objects are masked from crd (pos = 8):
hasil, perlakuan
The following objects are masked from crd (pos = 9):
hasil, perlakuan
> aov<-(hasil~perlakuan,data=crd)
Error: unexpected ',' in "aov<-(hasil~perlakuan,"
> avo<-aov(hasil~perlakuan,data=crd)
> avo
Call:
aov(formula = hasil ~ perlakuan, data = crd)
Terms:

perlakuan Residuals
Sum of Squares
717.5
625.0
Deg. of Freedom
3
25
Residual standard error: 5
Estimated effects may be unbalanced
> dunnet<-glht(avo,linfct=mcp(perlakuan="Dunnett))
+
+>
> dunnet
Error: object 'dunnet' not found
> dunnet<-glht(avo,linfct=mcp(perlakuan="Dunnett"))
> dunnet
General Linear Hypotheses
Multiple Comparisons of Means: Dunnett Contrasts
Linear Hypotheses:
Estimate
B - A == 0
12.0
C - A == 0
10.0
D - A == 0
1.5
> summary(dunnet
+>
> summary(dunnet)
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Dunnett Contrasts
Fit: aov(formula = hasil ~ perlakuan, data = crd)
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
B - A == 0 12.000
2.928 4.099 0.00108 **
C - A == 0 10.000
2.673 3.742 0.00285 **
D - A == 0 1.500
2.464 0.609 0.87478
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
(Adjusted p values reported -- single-step method)
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
The following objects are masked from crd (pos = 9):

hasil, perlakuan
The following objects are masked from crd (pos = 10):
hasil, perlakuan
> tky<-aov(hasil~perlakuan,data=crd)
> tky
Call:
aov(formula = hasil ~ perlakuan, data = crd)
Terms:
perlakuan Residuals
Sum of Squares
717.5
625.0
Deg. of Freedom
3
25
Residual standard error: 5
Estimated effects may be unbalanced
> summary(tky)
Df Sum Sq Mean Sq F value Pr(>F)
perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> tukey<-HSD.test(hasil,perlakuan,25,25,alpha=0.05)
> tukey
$statistics
Mean CV MSerror
HSD r.harmonic
10 50
25 7.442729 6.829268
$parameters
Df ntr StudentizedRange
25 4
3.889997
$means
hasil std r Min Max
A 5.0 3 7 1.0 9
B 17.0 7 5 9.0 26
C 15.0 7 7 6.0 23
D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> crd
perlakuan hasil

1
A 6.0
2
A 7.0
3
A 2.0
4
A 7.0
5
A 3.0
6
A 9.0
7
A 1.0
8
B 9.0
9
B 26.0
10
B 12.0
11
B 22.0
12
B 16.0
13
C 23.0
14
C 6.0
15
C 20.0
16
C 10.0
17
C 16.0
18
C 22.0
19
C 8.0
20
D 9.5
21
D 3.5
22
D 9.0
23
D 2.5
24
D 9.5
25
D 4.0
26
D 10.0
27
D 3.0
28
D 6.5
29
D 7.5
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
The following objects are masked from crd (pos = 4):
hasil, perlakuan
The following objects are masked from crd (pos = 10):
hasil, perlakuan
The following objects are masked from crd (pos = 11):
hasil, perlakuan
> dncn<-aov(hasil~perlakuan,data=crd)
> summary(dncn)
Df Sum Sq Mean Sq F value Pr(>F)
perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1

> tukey<-duncan.test(hasil,perlakuan,25,25,alpha=0.05)
> tukey
$statistics
Mean CV MSerror
10 50
25
$parameters
Df ntr
25 4
$Duncan
Table CriticalRange
2 2.912627
5.572728
3 3.059491
5.853722
4 3.153970
6.034489
$means
hasil std r Min Max
A 5.0 3 7 1.0 9
B 17.0 7 5 9.0 26
C 15.0 7 7 6.0 23
D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> duncan<-duncan.test(hasil,perlakuan,25,25,alpha=0.05)
> duncan
$statistics
Mean CV MSerror
10 50
25
$parameters
Df ntr
25 4
$Duncan
Table CriticalRange
2 2.912627
5.572728
3 3.059491
5.853722
4 3.153970
6.034489
$means
hasil std
A 5.0 3
B 17.0 7
C 15.0 7

r Min Max
7 1.0 9
5 9.0 26
7 6.0 23

D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
The following objects are masked from crd (pos = 4):
hasil, perlakuan
The following objects are masked from crd (pos = 5):
hasil, perlakuan
The following objects are masked from crd (pos = 11):
hasil, perlakuan
The following objects are masked from crd (pos = 12):
hasil, perlakuan
> sch<-aov(hasil~perlakuan,data=crd)
> summary(sch)
Df Sum Sq Mean Sq F value Pr(>F)
perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> scheffe<-scheffe.test.test(hasil,perlakuan,25,25,9.567,alpha=0.05)
Error: could not find function "scheffe.test.test"
> scheffe<-scheffe.test(hasil,perlakuan,25,25,9.567,alpha=0.05)
> scheffe
$statistics
Mean CV MSerror CriticalDifference
10 50
25
8.105583
$parameters
Df ntr
F Scheffe
25 4 2.991241 2.995617
$means

hasil std r Min Max


A 5.0 3 7 1.0 9
B 17.0 7 5 9.0 26
C 15.0 7 7 6.0 23
D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
The following objects are masked from crd (pos = 4):
hasil, perlakuan
The following objects are masked from crd (pos = 5):
hasil, perlakuan
The following objects are masked from crd (pos = 6):
hasil, perlakuan
The following objects are masked from crd (pos = 12):
hasil, perlakuan
The following objects are masked from crd (pos = 13):
hasil, perlakuan
> av<-aov(hasil~perlakuan,data=crd)
> summary(av)
Df Sum Sq Mean Sq F value Pr(>F)
perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> scheffe<-scheffe.test(hasil,perlakuan,25,25,alpha=0.05)
> snk<-scheffe.test(hasil,perlakuan,25,25,alpha=0.05)
> snk
$statistics
Mean CV MSerror CriticalDifference

10 50

25

8.105583

$parameters
Df ntr
F Scheffe
25 4 2.991241 2.995617
$means
hasil std r Min Max
A 5.0 3 7 1.0 9
B 17.0 7 5 9.0 26
C 15.0 7 7 6.0 23
D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b
> library(agricolae)
> attach(crd)
The following objects are masked from crd (pos = 3):
hasil, perlakuan
The following objects are masked from crd (pos = 4):
hasil, perlakuan
The following objects are masked from crd (pos = 5):
hasil, perlakuan
The following objects are masked from crd (pos = 6):
hasil, perlakuan
The following objects are masked from crd (pos = 7):
hasil, perlakuan
The following objects are masked from crd (pos = 13):
hasil, perlakuan
The following objects are masked from crd (pos = 14):
hasil, perlakuan
> dh<-aov(hasil~perlakuan,data=crd)

> summary(dh)
Df Sum Sq Mean Sq F value Pr(>F)
perlakuan 3 717.5 239.2 9.567 0.000219 ***
Residuals 25 625.0 25.0
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> snk<-snk.test(hasil,perlakuan,25,25,alpha=0.05)
Error: could not find function "snk.test"
> snk<-SNK.test(hasil,perlakuan,25,25,alpha=0.05)
> snk
$statistics
Mean CV MSerror
10 50
25
$parameters
Df ntr
25 4
$SNK
Table CriticalRange
2 2.912627
5.572728
3 3.522566
6.739723
4 3.889997
7.442729
$means
hasil std r Min Max
A 5.0 3 7 1.0 9
B 17.0 7 5 9.0 26
C 15.0 7 7 6.0 23
D 6.5 3 10 2.5 10
$comparison
NULL
$groups
trt means M
1 B 17.0 a
2 C 15.0 a
3 D 6.5 b
4 A 5.0 b

Вам также может понравиться