lm2: Fitting Bidimensional Regression Models

View source: R/bidimensional.R

lm2R Documentation

Fitting Bidimensional Regression Models

Description

lm2 is used to fit bidimensional linear regression models using Euclidean and Affine transformations following the approach by Tobler (1965).

Usage

lm2(formula, data, transformation)

Arguments

formula

a symbolic description of the model to be fitted in the format A + B ~ C + D, where A and B are dependent and C and D are independent variables

data

a data frame containing variables for the model.

transformation

the transformation to be used, either 'euclidean', 'affine', or 'projective'.

Value

lm2 returns an object of class "lm2". An object of class "lm" is a list containing at least the following components:

transformation

string with the transformation type (euclidean, affine, or projective)

npredictors

number of predictors used in the model: 4 for euclidean, 6 for affine, 8 for projective.

df_model, df_residual

degrees of freedom for the model and for the residuals

transformation_matrix

3x3 transformation matrix

coeff

transformation coefficients, with a denoting the intercept terms.

transformed_coeff

scale, angle, and sheer coefficients, depends on transformation.

fitted_values

data frame containing fitted values for the original data set

residuals

data frame containing residuals for the original fit

r.squared, adj.r.squared

R-squared and adjusted R-squared.

F, p.value

F-statistics and the corresponding p-value, given the df_model and df_residual degrees of freedom.

dAIC

Akaike Information Criterion (AIC) difference between the regression model and the null model. A negative values indicates that the regression model is better. See Nakaya (1997).

distortion_index

Distortion index following Waterman and Gordon (1984), as adjusted by Friedman and Kohler (2003)

lm

an underlying linear model for Euclidean and affine transformations.

formula

formula, describing input and output columns

data

data used to fit the model

Call

function call information, incorporates the formula, transformation, and data.

See Also

anova.lm2 BiDimRegression

Examples

lm2euc <- lm2(depV1 + depV2 ~ indepV1 + indepV2, NakayaData, 'euclidean')
lm2aff <- lm2(depV1 + depV2 ~ indepV1 + indepV2, NakayaData, 'affine')
lm2prj <- lm2(depV1 + depV2 ~ indepV1 + indepV2, NakayaData, 'projective')
anova(lm2euc, lm2aff, lm2prj)
predict(lm2euc)
summary(lm2euc)

BiDimRegression documentation built on March 18, 2022, 6:29 p.m.