regdistdiff: Regression difference between within-group dissimilarities

View source: R/reg2cluster2dist.R

regdistdiffR Documentation

Regression difference between within-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 the within-group distances of the two groups.

Usage


regdistdiff(x,dmx,dmy,grouping,xcenter=0,xcenterbetween=0)

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.

Value

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

Author(s)

Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en

References

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

See Also

regdistbetween

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))
  regdistdiff(rep(TRUE,35),ver.geo,vei$distmat,grouping=species,xcenter=0,xcenterbetween=100)


prabclus documentation built on Sept. 24, 2024, 5:07 p.m.