lmperm: Permutation test for regression parameters

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fit_model.R

Description

Compute permutation marginal test for linear model. This function produces t statistics with univariate and bivariate p-values. It gives the choice between multiple methods to handle nuisance variables.

Usage

1
lmperm(formula, data = NULL, np = 5000, method = NULL, ...)

Arguments

formula

A formula object.

data

A data frame or matrix.

np

The number of permutations. Default value is 5000.

method

A character string indicating the method use to handle nuisance variables. Default is "freedman_lane". Se details for the other methods.

...

Futher arguments, see details.

Details

The following methods are available for the fixed effects model defined as y = Dη + Xβ + ε. If we want to test β = 0 and take into account the effects of the nuisance variables D, we transform the data :

method argument y D X
"draper_stoneman" y D PX
"freedman_lane" (H_D+PR_D)y D X
"manly" Py D X
"terBraak" (H_{X,D}+PR_{X,D})y D X
"kennedy" PR_D y R_D X
"huh_jhun" PV'R_Dy V'R_D X
"dekker" y D PR_D X

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 n \times n to compute the rotation used for the "huh_jhun" method.

Value

A lmperm object. see aovperm.

Author(s)

[email protected]

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

aovperm plot.lmperm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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

permuco documentation built on Feb. 14, 2018, 5:04 p.m.