Description Usage Arguments Value Examples

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.

1 |

`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? |

distance between X and PX

1 | ```
with(mtcars, reg_dist(data.frame(wt, mpg), data.frame(sample(wt), mpg)))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.