permutation test
results with F-statistics, p-values, and strength of evidence.
Arguments
df
a data frame with at least three columns.
res
a character string, name of response variable.
mains
two character strings, names of two main factors.
nested
(optional) a character string, name of the nested factor.
nuis
(optional) a character string, name of the nuisance factor.
seed
an integer, the seed for random number generation. Setting a seed
ensures the reproducibility of the result. See set.seed for
more details.
rand
an integer, the number of randomization samples. The default value
is 1999.
emm
a logical, whether to compute estimated marginal means.
Details
res, mains, nested, and nuis refer to
column names in df. While nuis column must be a numeric
vector, mains and nested columns must be factors. res
can be a numeric or logical vector.
tw_complex currently
support linear models with only mains, generalized linear
mixed-effects models with mains and nested, and linear
mixed-effects models with mains, nested, and nuis.
References
Manly, B. F. J. (2007). Randomization, bootstrap, and Monte Carlo
methods in biology (3rd ed). Chapman & Hall/ CRC.
Ernst, M. D.
(2004). Permutation Methods: A Basis for Exact Inference. Statistical
Science, 19(4), 676–685. tools:::Rd_expr_doi("10.1214/088342304000000396").
Anderson,
M., & Braak, C. T. (2003). Permutation tests for multi-factorial analysis of
variance. Journal of Statistical Computation and Simulation, 73(2), 85–113.
tools:::Rd_expr_doi("10.1080/00949650215733").
# \donttest{tw_complex(df = subset(ctm_Cu, run == "Jan",
select = c("copper", "temp", "sediment")),
res = "sediment",
mains = c("copper", "temp"))
# }#might take more than 5s in some machines