# Perform a factorial permutation test

### Description

This function provides easy non-parametric permutation test analysis of data from factorial experiments, including purely within-Ss designs (a.k.a. “repeated measures”), purely between-Ss designs, and mixed within-and-between-Ss designs.

### Usage

1 2 3 4 5 6 7 8 9 10 |

### Arguments

`data` |
Data frame containing the data to be analyzed. |

`dv` |
Name of the column in |

`wid` |
Name of the column in |

`within` |
Names of columns in |

`between` |
Names of columns in |

`perms` |
An integer |

`parallel` |
Logical. If TRUE, computation will be parallel, assuming that a parallel backend has been specified (as in |

`alarm` |
Logical. If TRUE, call the |

### Value

A data frame containing the permutation test results.

### Warning

`ezPerm()`

is a work in progress. Under the current implementation, only main effects may be trusted.

### Author(s)

Michael A. Lawrence mike.lwrnc@gmail.com

Visit the `ez`

development site at http://github.com/mike-lawrence/ez

for the bug/issue tracker and the link to the mailing list.

### See Also

`link{ezANOVA}`

, `ezBoot`

, `ezMixed`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ```
library(plyr)
#Read in the ANT data (see ?ANT).
data(ANT)
head(ANT)
ezPrecis(ANT)
#Compute some useful statistics per cell.
cell_stats = ddply(
.data = ANT
, .variables = .( subnum , group , cue , flank )
, .fun = function(x){
#Compute error rate as percent.
error_rate = mean(x$error)*100
#Compute mean RT (only accurate trials).
mean_rt = mean(x$rt[x$error==0])
#Compute SD RT (only accurate trials).
sd_rt = sd(x$rt[x$error==0])
to_return = data.frame(
error_rate = error_rate
, mean_rt = mean_rt
, sd_rt = sd_rt
)
return(to_return)
}
)
#Compute the grand mean RT per Ss.
gmrt = ddply(
.data = cell_stats
, .variables = .( subnum , group )
, .fun = function(x){
to_return = data.frame(
mrt = mean(x$mean_rt)
)
return(to_return)
}
)
#Run a purely between-Ss permutation test on the mean_rt data.
mean_rt_perm = ezPerm(
data = gmrt
, dv = mrt
, wid = subnum
, between = group
, perms = 1e1 #1e3 or higher is best for publication
)
#Show the Permutation test.
print(mean_rt_perm)
``` |