The Williams test is a parametric test for trend. It is used to test for a trend when normality assumption is met.
williamsTest(df,resp,trt,direction='decreasing',SeIn=NULL)
A data set.
The name (as a string) of the response variable.
The name (as a string) of the treatment variable.
The direction of the test statistic which can either be 'increasing', 'decreasing').
This is used to specify a different standard error then the one calculated within the WilliamsTest function.
The treatment level the test statistic corresponds to.
The amalgamated averages for the treatment level.
The standard error.
The degrees of freedom.
The value of the Williams test statistic.
The critical value of the Williams test statistic, corresponding to a p-value of 0.05.
Williams D.A. (1971). A test for differences between treatment means when several dose levels are compared with a zero dose control. Biometrics 27(1):103-117. Green J., Springer T., Holbeck H. Statistical Analysis of Ecotoxicology Data (Wiley in press)
# NOT RUN {
#Data
data(lengthWeightData)
#Subset the data
SubData<-lengthWeightData[lengthWeightData$Age=='16 week', ]
SubData<-SubData[SubData$Generation=='F1', ]
SubData<-SubData[SubData$SEX=='M', ]
williamsTest(df=SubData, trt='Treatment',
resp='WEIGHT', direction='decreasing',SeIn=NULL)
# }
Run the code above in your browser using DataLab