Learn R Programming

matie (version 1.0)

ma.nl: Calculates nonlinear preportion of variance between one variable and a group of variables.

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

ma.nl(Y, X)

Arguments

Value

Returns a list of real numbers:Rsqlinear association, the value of R^2 due to the linear model Y ~ X.Atotal association (linear and nonlinear) between Y and the group X.rAthe residual association (the association left in the residuals after the linear part has been regressed out of Y).nl1A - 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.

Details

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

References

coming soon

See Also

ma agram

Examples

Run this code
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

Run the code above in your browser using DataLab