# ma.nl: Calculates degree of nonlinearity for a particular... In matie: Measuring Association and Testing Independence Efficiently

## Description

This function estimates nonlinear proportion of variance between one variable and a group of variables after linear association between the variable and the group has been removed.

## Usage

 `1` ```ma.nl(Y, X) ```

## Arguments

 `Y` A vector or a one column data frame. `X` a group of vectors or a data frame with the same number of samples as in Y

## Details

A linear model, `Y ~ X`, is constructed and `ma` is used to compute R^2 between Y and X.

## Value

Returns a list of real numbers:

 `Rsq` linear association, the value of R^2 due to the linear model `Y ~ X`. `A` total association (linear and nonlinear) between Y and the group X. `rA` the residual association (the association left in the residuals after the linear part has been regressed out of Y). `nl1` A - Rsq, the nonlinear part of the association. `nl2` (A - Rsq) / A, the nonlinear proportion of the association. `nl3` (A - Rsq) / (1 - Rsq), the proportion of total variance that is not explained by a linear model but is explained by A.

## Author(s)

Ben Murrell, Dan Murrell & Hugh Murrell.

## References

Discovering general multidimensional associations, http://arxiv.org/abs/1303.1828

`ma` `agram`
 ``` 1 2 3 4 5 6 7 8 9 10 11``` ``` X1 = runif(1000) X2 = runif(1000) Y = sin(0.5*pi*X1) + sin(0.5*pi*X2) + rnorm(1000)*0.000001 ma.nl(Y,cbind(X1,X2)) # # in the case of bivariate associations all these measures # are symmetric apart from rA, the residual association X = runif(1000) Y = sin(0.5*pi*X) + rnorm(1000)*0.01 ma.nl(Y,X)\$rA ma.nl(X,Y)\$rA ```