Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set alpha in R?
    text
    copied!<p>I have <a href="http://rss.acs.unt.edu/Rdoc/library/coin/html/LocationTests.html" rel="nofollow noreferrer">this example</a> from the coin package of R:</p> <pre><code> library(coin) library(multcomp) ### Length of YOY Gizzard Shad from Kokosing Lake, Ohio, ### sampled in Summer 1984, Hollander &amp; Wolfe (1999), Table 6.3, page 200 YOY &lt;- data.frame(length = c(46, 28, 46, 37, 32, 41, 42, 45, 38, 44, 42, 60, 32, 42, 45, 58, 27, 51, 42, 52, 38, 33, 26, 25, 28, 28, 26, 27, 27, 27, 31, 30, 27, 29, 30, 25, 25, 24, 27, 30), site = factor(c(rep("I", 10), rep("II", 10), rep("III", 10), rep("IV", 10)))) ### Nemenyi-Damico-Wolfe-Dunn test (joint ranking) ### Hollander &amp; Wolfe (1999), page 244 ### (where Steel-Dwass results are given) NDWD &lt;- oneway_test(length ~ site, data = YOY, ytrafo = function(data) trafo(data, numeric_trafo = rank), xtrafo = function(data) trafo(data, factor_trafo = function(x) model.matrix(~x - 1) %*% t(contrMat(table(x), "Tukey"))), teststat = "max", distribution = approximate(B = 90000)) ### global p-value print(pvalue(NDWD)) ### sites (I = II) != (III = IV) at alpha = 0.01 (page 244) print(pvalue(NDWD, method = "single-step")) </code></pre> <p>I want to assign alpha a different value, how can I do this??</p> <p>This doesn't work!</p> <pre><code> library(coin) library(multcomp) ### Length of YOY Gizzard Shad from Kokosing Lake, Ohio, ### sampled in Summer 1984, Hollander &amp; Wolfe (1999), Table 6.3, page 200 YOY &lt;- data.frame(length = c(46, 28, 46, 37, 32, 41, 42, 45, 38, 44, 42, 60, 32, 42, 45, 58, 27, 51, 42, 52, 38, 33, 26, 25, 28, 28, 26, 27, 27, 27, 31, 30, 27, 29, 30, 25, 25, 24, 27, 30), site = factor(c(rep("I", 10), rep("II", 10), rep("III", 10), rep("IV", 10)))) ### Nemenyi-Damico-Wolfe-Dunn test (joint ranking) ### Hollander &amp; Wolfe (1999), page 244 ### (where Steel-Dwass results are given) NDWD &lt;- oneway_test(length ~ site, data = YOY, ytrafo = function(data) trafo(data, numeric_trafo = rank), xtrafo = function(data) trafo(data, factor_trafo = function(x) model.matrix(~x - 1) %*% t(contrMat(table(x), "Tukey"))), teststat = "max", distribution = approximate(B = 90000), alpha = 0.05) ### global p-value print(pvalue(NDWD)) ### sites (I = II) != (III = IV) at alpha = 0.05 (default was 0.01) (page 244) print(pvalue(NDWD, method = "single-step")) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload