Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

5/30/22, 12:52 PM New Tab

> library(readxl)
> library(ExpDes)
> data <- read_excel("D:/Latihan R/datafaktorialrak.xlsx", sheet =1, col_names = TRUE, col_types = NULL, na="")
> mydata1<- data
> names(mydata1)
[1] "Perlakuan" "Blok" "Nitrogen" "Varietas" "Hasil"
> attach(mydata1)
The following objects are masked from mydata1 (pos = 3):

Hasil, Nitrogen, Perlakuan, Varietas

The following object is masked from mydata1 (pos = 4):

Nitrogen

The following object is masked from mydata1 (pos = 5):

Nitrogen

The following object is masked from mydata1 (pos = 6):

Nitrogen

The following objects are masked from mydata1 (pos = 7):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following objects are masked from mydata1 (pos = 8):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following objects are masked from my_data1:

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following objects are masked from mydata1 (pos = 10):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following objects are masked from mydata1 (pos = 11):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following objects are masked from mydata1 (pos = 12):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following object is masked from mydata1 (pos = 13):

Nitrogen

The following object is masked from mydata1 (pos = 14):

Nitrogen

The following object is masked from mydata1 (pos = 15):

Nitrogen

The following objects are masked from mydata1 (pos = 16):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

The following object is masked from mydata1 (pos = 17):

Nitrogen

The following objects are masked from mydata1 (pos = 18):

Blok, Hasil, Nitrogen, Perlakuan, Varietas

> detach(mydata1)
>
> fat2.rbd(
+ Varietas,
+ Nitrogen,
+ Blok,
+ Hasil,
+ quali = c(TRUE, TRUE ),

chrome://newtab 1/3
5/30/22, 12:52 PM New Tab
+ mcomp = "lsd",
+ fac.names = c("Varietas", "Nitrogen"),
+ sigT = 0.05,
+ sigF = 0.05,
+ unfold = NULL
+ )
------------------------------------------------------------------------
Legend:
FACTOR 1: Varietas
FACTOR 2: Nitrogen
------------------------------------------------------------------------

Analysis of Variance Table


------------------------------------------------------------------------
DF SS MS Fc Pr>Fc
Block 3 1944361 6 5.8622 0.00742
Varietas 2 60851 4 0.2752 0.76318
Nitrogen 1 1024240 2 9.2642 0.00821
Varietas*Nitrogen 2 113240 5 0.5121 0.60933
Residuals 15 1658376 3
Total 23 4801068 1
------------------------------------------------------------------------
CV = 6.7 %

------------------------------------------------------------------------
Shapiro-Wilk normality test
p-value: 0.4871759
According to Shapiro-Wilk normality test at 5% of significance, residuals can be considered normal.
------------------------------------------------------------------------

No significant interaction: analyzing the simple effect


------------------------------------------------------------------------
Varietas
According to the F test, the means of this factor are statistical equal.
------------------------------------------------------------------------
Levels Means
1 V1 4985.875
2 V2 4889.125
3 V3 5003.750
------------------------------------------------------------------------
Nitrogen
T test (LSD)
------------------------------------------------------------------------
Groups Treatments Means
a N1 5166.167
b N2 4753
------------------------------------------------------------------------

>
>
>
> library(agricolae)
> ### UJI ADITIVITAS MODEL
> modelRAK <- lm(Hasil~Blok+Perlakuan)
> df <- df.residual(model)
Error in df.residual(model) : object 'model' not found
> MSerror <- deviance(model)/df
Error in deviance(model) : object 'model' not found
> analysis<-with(mydata1,nonadditivity(Hasil,Blok,Perlakuan,df,MSerror))

Tukey's test of nonadditivity


Hasil

P : 226670438
Q : 388331256285

Analysis of Variance Table

Response: residual
Df Sum Sq Mean Sq F value Pr(>F)
Nonadditivity 1 132308 132308 -123.08 1
Residuals 123 -132217 -1075
>
> rbd(Nitrogen,Perlakuan,Hasil,quali = TRUE,mcomp = "lsd",sigT=0.05)
------------------------------------------------------------------------
Analysis of Variance Table
------------------------------------------------------------------------
DF SS MS Fc Pr>Fc
Treatament 1 1024240 1024240 5.1173 0.03630

chrome://newtab 2/3
5/30/22, 12:52 PM New Tab
Block 4 174091 43523 0.2174 0.92525
Residuals 18 3602737 200152
Total 23 4801068
------------------------------------------------------------------------
CV = 9.02 %

------------------------------------------------------------------------
Shapiro-Wilk normality test
p-value: 0.8156343
According to Shapiro-Wilk normality test at 5% of significance, residuals can be considered normal.
------------------------------------------------------------------------

------------------------------------------------------------------------
Homogeneity of variances test
p-value: NaN
Error in if (pvalor.hvar < 0.05) { :
missing value where TRUE/FALSE needed
>
>
> ### uji kehomogenan (barttlett)
> bartlett.test(Hasil~Perlakuan)

Bartlett test of homogeneity of variances

data: Hasil by Perlakuan


Bartlett's K-squared = 5.3464, df = 5, p-value = 0.3751

chrome://newtab 3/3

You might also like