Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/permutationtest.R
Perform permutation tests for differences between two groups at given within-subject levels in a long-formatted dataframe
1 2 3 4 5 6 7 8 9 10 |
data |
dataframe that contains the data in long format. |
outcome |
outcome variable (i.e., the variable for which the difference should be tested). |
within |
within-subject variable. |
between |
between-subjects variable. |
at.within |
determine for which within-subject levels (e.g., which timepoint) the difference should be tested. |
at.between |
determine the groups in the difference test (should always be of length 2). |
pn |
the number of permutations that should be performed. |
progress.bar |
indicates whether a progress bar will be shown. |
In every permutation cycle, the outcome variable gets permutated and the Welch t test statistic is calculated.
ptest
produces an object of class "clusbootptest"
, containing the following relevant components:
perm.statistics |
A matrix of |
pvalues |
Data frame containing the p values for every |
Mathijs Deen, Mark de Rooij
A useful method for the obtained clusbootptest
class object is plot.clusbootptest
.
1 2 3 4 5 6 7 | ## Not run:
medication <- medication[medication$time %% 1 == 0,]
set.seed(1)
permtest.1 <- ptest(data = meds, outcome = pos, within = time, between = treat,
at.within = c(0,2,4,6), at.between = c(0,1), pn = 2000)
permtest.1$pvalues
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.