Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

regdist

Regression between subsets of dissimilarity matrices


Description

Given two dissimilarity matrices dmx and dmy and an indicator vector x, this computes a standard least squares regression between the dissimilarity between objects indicated in x.

Usage

regdist(x,dmx,dmy,xcenter=0,param)

Arguments

x

vector of logicals of length of the number of objects on which dissimilarities dmx and dmy are based.

dmx

dissimilarity matrix or object of class dist. Explanatory dissimilarities.

dmy

dissimilarity matrix or object of class dist. Response dissimilarities.

xcenter

numeric. Dissimilarities dmx are centered by this, i.e., this value is subtracted from the dissimilarities before regression.

param

1 or 2 or NULL. If 1 or 2, only the first or second parameter (intercept or slope) of the regression is given out.

Value

If param=NULL, the output object of lm. If param=1 the intercept. If param=2 the slope.

Author(s)

References

Hausdorf, B. and Hennig, C. (2019) Species delimitation and geography. Submitted.

Examples

options(digits=4)
  data(veronica)
  ver.geo <- coord2dist(coordmatrix=veronica.coord[1:20,],file.format="decimal2")
  vei <- prabinit(prabmatrix=veronica[1:20,],distance="jaccard")
  regdist(c(rep(TRUE,10),rep(FALSE,10)),ver.geo,vei$distmat,param=1)

prabclus

Functions for Clustering and Testing of Presence-Absence, Abundance and Multilocus Genetic Data

v2.3-2
GPL
Authors
Christian Hennig <christian.hennig@unibo.it>, Bernhard Hausdorf <Hausdorf@zoologie.uni-hamburg.de>
Initial release
2020-01-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.