Compute permutation marginal tests for linear models. This function produces t statistics with univariate and bivariate p-values. It gives the choice between multiple methods to handle nuisance variables.
lmperm(
formula,
data = NULL,
np = 5000,
method = NULL,
type = "permutation",
...
)
A formula object.
A data frame or matrix.
The number of permutations. Default value is 5000
.
A character string indicating the method use to handle nuisance variables. Default is "freedman_lane"
. For the other methods, see details.
A character string to specify the type of transformations: "permutation" and "signflip" are available. Is overridden if P is given. See help from Pmat.
Futher arguments, see details.
A lmperm
object. See aovperm.
The following methods are available for the fixed effects model defined as
method argument |
|
|
|
"draper_stoneman" |
|
|
|
"freedman_lane" |
|
|
|
"manly" |
|
|
|
"terBraak" |
|
|
|
"kennedy" |
|
|
|
"huh_jhun" |
|
|
|
"dekker" |
|
|
|
Other arguments could be pass in ...
:
P
: a matrix containing the permutations of class matrix
or Pmat
for the reproductibility of the results. The first column must be the identity. P
overwrites np
argument.
rnd_rotation
: a random matrix of size "huh_jhun"
method.
Kherad-Pajouh, S., & Renaud, O. (2010). An exact permutation method for testing any effect in balanced and unbalanced fixed effect ANOVA. Computational Statistics & Data Analysis, 54(7), 1881-1893.
Kherad-Pajouh, S., & Renaud, O. (2015). A general permutation approach for analyzing repeated measures ANOVA and mixed-model designs. Statistical Papers, 56(4), 947-967.
Winkler, A. M., Ridgway, G. R., Webster, M. A., Smith, S. M., & Nichols, T. E. (2014). Permutation inference for the general linear model. Neuroimage, 92, 381-397.
# NOT RUN {
## data
data("emergencycost")
## Testing at 14 days
emergencycost$LOS14 <- emergencycost$LOS - 14
## Univariate t test
contrasts(emergencycost$insurance) <- contr.sum
contrasts(emergencycost$sex) <- contr.sum
## Warning : np argument must be greater (recommendation: np>=5000)
modlm_cost_14 <- lmperm(cost ~ LOS14*sex*insurance, data = emergencycost, np = 2000)
modlm_cost_14
# }
Run the code above in your browser using DataLab