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

regdistdiffone

Regression difference within reference group and between-group dissimilarities


Description

Given two dissimilarity matrices dmx and dmy, an indicator vector x and a grouping, this computes the difference between standard least squares regression predictions at point xcenterbetween. The regressions are based on the dissimilarities in dmx vs. dmy for objects indicated in x. grouping indicates the two groups, and the difference is computed between regressions based on (a) the within-group distances of the reference group rgroup and (b) these together with the between-group distances.

Usage

regdistdiffone(x,dmx,dmy,grouping,xcenter=0,xcenterbetween=0,rgroup)

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.

grouping

vector of length of the number of objects on which dissimilarities dmx and dmy are based. Grouping vector. Regressions will be based on the first two values that appear in unique(grouping[x]) (note that objects that are not assigned to one of these groups will be ignored); normally grouping should indicate only two groups on the objects with x=TRUE, and then these are used.

xcenter

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

xcenterbetween

numeric. This specifies the x- (dissimilarity) value at which predictions from the two regressions are compared. Note that this is interpreted as after centering by xcenter.

rgroup

one of the values of grouping, specifying the reference group.

Value

Difference between standard least squares regression predictions for the two regressions at point xcenterbetween.

Author(s)

References

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

See Also

Examples

options(digits=4)
  data(veronica)
  ver.geo <- coord2dist(coordmatrix=veronica.coord[173:207,],
    file.format="decimal2")
  vei <- prabinit(prabmatrix=veronica[173:207,],distance="jaccard")

  species <-c(rep(1,13),rep(2,22))
  regdistdiffone(rep(TRUE,35),ver.geo,vei$distmat,grouping=species,
    xcenter=0,xcenterbetween=100,rgroup=2)

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.