Function lmorigin
computes a multiple linear regression and performs tests of significance of the equation parameters (Ftest of Rsquare and ttests of regression coefficients) using permutations.
The regression line can be forced through the origin. Testing the significance in that case requires a special permutation procedure. This option was developed for the analysis of independent contrasts, which requires regression through the origin. A permutation test, described by Legendre & Desdevises (2009), is needed to analyze contrasts that are not normally distributed.
1 
formula 
A formula specifying the bivariate model, as in

data 
A data frame containing the two variables specified in the formula. 
origin 

nperm 
Number of permutations for the tests. If 
method 

silent 
Informative messages and the time to compute the tests will not be written to the R console if silent=TRUE. Useful when the function is called by a numerical simulation function. 
The permutation Ftest of Rsquare is always done by permutation of the raw data. When there is a single explanatory variable, permutation of the raw data is used for the ttest of the single regression coefficient, whatever the method chosen by the user. The rationale is found in Anderson & Legendre (1999).
The print.lmorigin
function prints out the results of the parametric tests (in all cases) and the results of the permutational tests (when nperm > 0).
reg 
The regression output object produced by function 
p.param.t.2tail 
Parametric probabilities for 2tailed tests of the regression coefficients. 
p.param.t.1tail 
Parametric probabilities for 1tailed tests of the regression coefficients. Each test is carried out in the direction of the sign of the coefficient. 
p.perm.t.2tail 
Permutational probabilities for 2tailed tests of the regression coefficients. 
p.perm.t.1tail 
Permutational probabilities for 1tailed tests of the regression coefficients. Each test is carried out in the direction of the sign of the coefficient. 
p.perm.F 
Permutational probability for the Ftest of Rsquare. 
origin 
TRUE is regression through the origin has been computed, FALSE if multiple regression with estimation of the intercept has been used. 
nperm 
Number of permutations used in the permutation tests. 
method 
Permutation method for the ttests of the regression coefficients: 
var.names 
Vector containing the names of the variables used in the regression. 
call 
The function call. 
Pierre Legendre, Universite de Montreal
Anderson, M. J. and Legendre, P. (1999) An empirical comparison of permutation methods for tests of partial regression coefficients in a linear model. Journal of Statistical Computation and Simulation, 62, 271–303.
Legendre, P. and Desdevises, Y. (2009) Independent contrasts and regression through the origin. Journal of Theoretical Biology, 259, 727–743.
Sokal, R. R. and Rohlf, F. J. (1995) Biometry  The principles and practice of statistics in biological research. Third edition. New York: W. H. Freeman.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  ## Example 1 from Sokal & Rohlf (1995) Table 16.1
## SO2 air pollution in 41 cities of the USA
data(lmorigin.ex1)
out < lmorigin(SO2 ~ ., data=lmorigin.ex1, origin=FALSE, nperm=99)
out
## Example 2: Contrasts computed on the phylogenetic tree of Lamellodiscus
## parasites. Response variable: nonspecificity index (NSI); explanatory
## variable: maximum host size. Data from Table 1 of Legendre & Desdevises
## (2009).
data(lmorigin.ex2)
out < lmorigin(NSI ~ MaxHostSize, data=lmorigin.ex2, origin=TRUE, nperm=99)
out
## Example 3: random numbers
y < rnorm(50)
X < as.data.frame(matrix(rnorm(250),50,5))
out < lmorigin(y ~ ., data=X, origin=FALSE, nperm=99)
out

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.