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:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
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.
Y=c(14.823,
14.676,
14.72,
14.5141,
15.065,
25.151,
25.401,
25.131,
25.031,
25.267,
32.605,
32.46,
32.256,
32.669,
32.111
)
trat=rep(c("trat1","trat2","trat3"),each=5)
df<-data.frame(trat=trat,Y=Y)
modelo<-aov(Y~trat,data=df)
summary(modelo)
## Df Sum Sq Mean Sq F value Pr(>F)
## trat 2 788.3 394.2 10132 <2e-16 ***
## Residuals 12 0.5 0.0
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
boxplot(Y~trat,data=df)
h<-TukeyHSD(modelo)
h
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Y ~ trat, data = df)
##
## $trat
## diff lwr upr p adj
## trat2-trat1 10.43658 10.10377 10.76939 0
## trat3-trat1 17.66058 17.32777 17.99339 0
## trat3-trat2 7.22400 6.89119 7.55681 0
plot(h)
res<-modelo$residuals
qqnorm(res)
qqline(res)
shapiro.test(res)
##
## Shapiro-Wilk normality test
##
## data: res
## W = 0.97219, p-value = 0.8891