[R] Scheffe test
Marcelo
ocbruno at netscape.net
Thu Aug 14 21:44:39 CEST 2003
Hi, Ana
try these source:
# Scheffe test, according Zar, J.H. (1984) Biostatistical Analysis.
# Englewood Cliffs: Prentice Hall.
# -----------------------------------------------------------------
Scheffe1<- function(mxa,mxb,ms,na,nb,k,F) {
# multiple comparision
# DMSa=| meanXa- meanXb |
# DMSc= critic value
# if DMSa > DMSc --> reject H0
# where mxa is mean of one group dataset,
# and mxb is outher group dataset
# na is number of samples for group a
# nb is number of samples for group b
# ms is mean square, F is F value, k is treatments
result<-0
DMSa<- abs(mxa-mxb)
DMSc<- sqrt(((1/na)+(1/nb))*(k-1)*(ms)*(F))
if (DMSa > DMSc) result<-c("rej. H0") else result<- c("ac. H0")
return(cbind(result))
}
save as name.R in your work directory.
Hope this helps.
--
Oceanólogo Marcelo Alexandre Bruno
# Linux User: 124592 #
Pós-graduação Oceanografia Biológica
FUNDACAO UNIV. FEDERAL do RIO GRANDE
Departamento de Oceanografia
Lab. de Ecologia do Ictioplâncton
AV. ITÁLIA km 8 s/n - CARREIROS
Cx. Postal 474
96201-900 (0xx53) 2336529
Rio Grande - RS - BRAZIL
More information about the R-help
mailing list