lmperm {permuco} | R Documentation |
Permutation tests for regression parameters
Description
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.
Usage
lmperm(
formula,
data = NULL,
np = 5000,
method = NULL,
type = "permutation",
...
)
Arguments
formula |
A formula object. |
data |
A data frame or matrix. |
np |
The number of permutations. Default value is |
method |
A character string indicating the method use to handle nuisance variables. Default is |
type |
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. |
Details
The following methods are available for the fixed effects model defined as . If we want to test
and take into account the effects of the nuisance variables
, we transform the data :
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 to compute the rotation used for the
"huh_jhun"
method.
Value
A lmperm
object. See aovperm.
Author(s)
jaromil.frossard@unige.ch
References
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.
See Also
Other main function:
aovperm()
,
clusterlm()
Examples
## 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