Calculates the bidimensional regression between two 2D configurations using both Euclidean and Affine transformations following the approach by Tobler (1965). This function assumes strict data format and returns all coefficients and statistics in a single structure. Same functionality is now re-implemented in a R-friendly style, see lm2 function.

## Usage

BiDimRegression(coord)

## Arguments

coord

table that must contain two columns for dependent variables (named depV1 and depV2) and two columns for independent variables (named indepV1 and indepV2).

## Value

an S3 class BiDimRegression containing all essential measures of the bidimensional regression

• euclidean.r, affine.r - the regression coefficient, defined analogously to Pearson's r.

• euclidean.rsqr, affine.rsqr - the squared regression coefficient.

• euclidean.diABSqr, affine.diABSqr - the squared distortion index for dependent variables; following Waterman and Gordon's (1984) extension of the bidimensional regression, it provides a measure of comparison of distortions, but the range of values is 0 to 1 following Friedman and Kohler (2003).

• euclidean.dMaxABSqr, affine.dMaxABSqr - the maximal squared distortion index for dependent variables.

• euclidean.diXYSqr, affine.diXYSqr - the distortion index for independent variables.

• euclidean.dMaxXYSqr, affine.dMaxXYSqr - the maximal squared distortion index for independent variables.

• euclidean.scaleFactorX, affine.scaleFactorX - the scaling factor of the first dimension (1.0 means no scaling; values below 1.0 indicate a contraction, values above 1.0 indicate an expansion).

• euclidean.scaleFactorY, affine.scaleFactorY - the scaling factor of the second dimension.

• euclidean.angleDEG, affine.angleDEG - the rotation angle in degrees.

• euclidean.shear, affine.shear - shearing of the transformed configuration, always zero for the Euclidean transformation.

• euclidean.ttestDF, affine.ttestDF - degrees of freedom (DF) for the t-tests regarding the model parameters (alphas and betas).

• euclidean.alpha1.*, euclidean.alpha2.*, affine.alpha1.*, affine.alpha2.* - intercept vectors, information includes .coeff for coefficient, .SE for standard error, tValue for t-statistics, and pValue for significance.

• euclidean.beta1.*, euclidean.beta2.*, affine.beta1.*, affine.beta2.*, affine.beta3.*, affine.beta4.* - slope vectors, information includes .coeff for coefficient, .SE for standard error, tValue for t-statistics, and pValue for significance.

• euclidean.fValue, affine.fValue - F-statistics, following the advice of Nakaya (1997).

• euclidean.df1, affine.df1 - degrees of freedom of the nominator used for the F-statistics propagated by Nakaya (1997); df1 = p-2, with p is the number of elements needed to calculate the referring model: p=4 for the Euclidean and p=6 for the affine geometry Nakaya, 1997, Table 1.

• euclidean.df2, affine.df2 - degrees of freedom of the denominator used for the F-statistics propagated by Nakaya (1997); df2 = 2n-p, with p is the number of elements needed to calculate the referring model (see df1) and n is the number of coordinate pairs.

• euclidean.pValue, affine.pValue - the significance level based on the preceding F-statistics.

• euclidean.dAICso, affine.dAICso - the AIC difference between the regarding bidimensional regression model and the bidimensional null model (S0) according to Nakaya (1997), formula 56.

• eucVSaff.* - statistical comparison between Euclidean and Affine models, include .fValue for F-statistics, .df1 and .df2 for the degrees of freedom, .pValue for the significance level, and .dAIC for AIC difference between two models.

lm2

## Examples

resultingMeasures <- BiDimRegression(NakayaData)
print(resultingMeasures)
#>
#> -------------------
#> BiDimRegression 2.0.1
#> Date-Time: Thu Feb 17 12:07:33 2022
#> ----------------------------------------------------------------------
#>
#> --- overall statistics ---
#>                 r   r-sqr F-value df1 df2 p-value
#> Euclidean   0.969   0.938 258.199   2  34  <2e-16 ***
#> Affine      0.980   0.961 196.124   4  32  <2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> ----------------------------------------------------------------------
#>
#> --- parameters ---
#>
#> - Euclidean -
#>        Parameter Std.Err t-value df p-value
#> alpha1    0.1408  0.0959  1.4684 32    0.15
#> alpha2   -0.0106  0.0959 -0.1104 32    0.91
#>
#>        Parameter Std.Err t-value df p-value
#> beta1     1.3487  0.0644 20.9557 32 < 2e-16 ***
#> beta2     0.5657  0.0644  8.7897 32 2.8e-10 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#>
#> - Affine -
#>        Parameter Std.Err t-value df p-value
#> alpha1    0.1929  0.0835  2.3087 32   0.028 *
#> alpha2   -0.1191  0.0835 -1.4251 32   0.164
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#>        Parameter Std.Err t-value df p-value
#> beta1     1.3220  0.0794 16.6454 32 < 2e-16 ***
#> beta2    -0.3715  0.0724 -5.1305 32 1.4e-05 ***
#> beta3     0.8189  0.0794 10.3106 32 1.1e-11 ***
#> beta4     1.4350  0.0724 19.8194 32 < 2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> ----------------------------------------------------------------------
#>
#> --- details ---
#>
#> - Euclidean -			- Affine -
#> scaleX	= scaleY = 1.463	scaleX	= 1.555, scaleY = 1.416
#> shear	= 0.000			shear	= 0.311
#> angle	= 22.755 DEG		angle	= 31.775 DEG
#> ---				---
#> DAIC (agst.0)	= -101.80	DAIC (agst.0)	= -115.09
#> ---				---
#> dMaxABSqr	= 83.681	dMaxABSqr	= 83.681
#> diABSqr  	= 0.062		diABSqr  	= 0.039
#> dMaxXYSqr	= 36.706	dMaxXYSqr	= 36.706
#> diXYSqr  	= 0.514		diXYSqr  	= 0.168
#> ----------------------------------------------------------------------
#>
#> --- comparative statistics of fitted bidimensional regxsion models
#>
#>                      F-value df1 df2 p-value
#> Euclidean vs. Affine    9.22   2  32 0.00069 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#>
#> DAICea = -13.290 (significantly better: Affine solution)
#>
#> **********************************************************************
#>
#>