Skip to contents

The function is adapted from the archived version of StatCharrms developed by Joe Swintek et al with CC0 license. It is not updated anymore and included for validation purpose. We recommend to use the williamsTest from PMCMRplus package instead.

Usage

williamsTest_JG(df, resp, trt, direction = "decreasing", SeIn = NULL)

Arguments

df

The data frame

resp

The name of the response as a string

trt

The name of the response as a string

direction

Is the direction of the test 'decreasing' or 'increasing'

SeIn

the standard error, default is program selected. WilliamsTest can take in a different value in the case of repeated measures

Value

Williams' test result

Examples

## Williams Test
x <- c(106, 114, 116, 127, 145,110, 125, 143, 148, 151,
136, 139, 149, 160, 174)
g <- gl(3,5)
levels(g) <- c("0", "I", "II")
PMCMRplus::williamsTest(x ~ g)
#> 
#> 	 Williams trend test 
#> 
#> data:  x by g 
#> alternative hypothesis:  greater 
#> 
#> H0
#>                t'-value df t'-crit decision alpha
#> mu1 - ctr <= 0    1.357 12   1.782   accept  0.05
#> mu2 - ctr <= 0    2.950 12   1.873   reject  0.05
#> ---
williamsTest_JG(data.frame(treatment_var = g,response_var=x),
"response_var","treatment_var",direction="increasing")
#>   treatment_var Y.Tilde    Y0 Se.Diff DF  Will TCrit Signif
#> 2            II   151.6 121.6   10.17 12 2.950 1.873      *
#> 1             I   135.4 121.6   10.17 12 1.357 1.782      .