reg_dist: Distance based on the regression parameters

Description Usage Arguments Value Examples

View source: R/distances.r

Description

Dataset X is binned into 5 bins in x-direction. A regression line is fitted to the data in each bin and the regression coefficients are noted. Same is done for dataset PX. An euclidean distance is calculated between the two sets of regression parameters. If the relationship between X and PX looks linear, number of bins should be equal to 1.

Usage

1
reg_dist(X, PX, nbins = 1, intercept = TRUE, scale = TRUE)

Arguments

X

a data.frame with two variables, the first column giving the explanatory variable and the second column giving the response variable

PX

another data.frame with two variables, the first column giving the explanatory variable and the second column giving the response variable

nbins

number of bins on the x-direction, by default nbins = 1

intercept

include the distances between intercepts?

scale

logical value: should the variables be scaled before computing regression coefficients?

Value

distance between X and PX

Examples

1

nullabor documentation built on Feb. 26, 2020, 1:07 a.m.