This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
#ANOVA ONE WAY
pupuk <- c(1,1,1,
2,2,2,2,
3,3,3,
4,4,4,4,4)
berat <- c(5.1, 5.3, 5.0,
4.8, 5.0, 5.2, 4.9,
6.2, 6.5, 6.1,
6.8, 7.0, 6.7, 7.1, 6.9)
anova123 <- data.frame(pupuk=factor(pupuk),berat=berat)
hasil.aov <- aov(berat~pupuk,anova123)
summary(hasil.aov)
#UJI ASUMSI
#1. Uji Normalitas
residu = residuals(hasil.aov)
shapiro.test(residu)
#2. Uji Kesamaan Varians
hasil_levene = leveneTest(hasil.aov)
hasil_levene
#3. Asumsi Independensi
bebas = t.test(residu)
bebas
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.