regdist: Regression between subsets of dissimilarity matrices

View source: R/reg2cluster2dist.R

regdistR Documentation

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)

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.

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 documentation built on Sept. 24, 2024, 5:07 p.m.