Jackknife-based test for equality of two regressions between distance matrices.
regeqdist(dmx,dmy,grouping,groups=levels(as.factor(grouping))[1:2])# S3 method for regeqdist
print(x,...)
list of class "regeqdist" with components
p-values for intercept and slope.
vector of differences between groups (first minus second) for intercept and slope.
condition numbers of regressions, see kappa.
list. Output objects of lm within the two groups.
list of two lists of two; output object of
    jackknife within the two groups for intercept and
    slope.
mean of dmx within the two groups used for centering.
t-statistic.
vector of degrees of freedom of t-statistic according to Welch-Sattertwaithe approximation for intercept and slope.
jackknife-estimator of difference between regressions; vector with intercept and slope difference.
vector with jackknife-standard errors for
    jackest, intercept and slope.
list of two lists of vectors; jacknife pseudovalues within both groups for intercept and slope estimators.
see above.
dissimilarity matrix or object of class
    dist. Explanatory dissimilarities (often these will be proper
    distances, but more general dissimilarities that do not
    necessarily fulfill the triangle inequality can be used, same for
    dmy).
dissimilarity matrix or object of class
    dist. Response dissimilarities.
something that can be coerced into a factor,
    defining the grouping of
    objects represented by the dissimilarities dmx and dmy
    (i.e., if grouping has length n, dmx and dmy
    must be dissimilarities between n objects).
Vector of two, indicating the two groups defining the
    regressions to be compared in the test. These can be
    factor levels, integer numbers, or strings, depending on the entries
    of grouping.
object of class "regeqdist".
optional arguments for print method.
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en
The null hypothesis that the regressions within the two groups are equal is tested using jackknife pseudovalues independently in both groups allowing for potentially different variances of the pseudovalues, and aggregating as in Welch's t-test. Tests are run separately for intercept and slope and aggregated by Bonferroni's rule.
The test cannot be run and many components will be NA in case that
  within-group regressions or jackknifed within-group regressions are
  ill-conditioned.
This was implemented having in mind an application in which the
  explanatory distances represent geographical distances, the response
  distances are genetic distances, and groups represent species or
  species-candidates. In this application, for testing whether the
  regression patterns are compatble with the two groups behaving like a
  single species, one would first use regeqdist to test whether a
  joint regression for the within-group distances of both groups makes
  sense. If this is not rejected, regdistbetween is run to see
  whether the between-group distances are compatible with the
  within-group distances. On the other hand, if a joint regression on
  within-group distances is rejected, regdistbetweenone can be
  used to test whether the between-group distances are at least
  compatible with the within-group distances of one of the groups, which
  can still be the case within a single species, see Hausdorf and Hennig (2019).
Hausdorf, B. and Hennig, C. (2019) Species delimitation and geography. Submitted.
regdistbetween, regdistbetweenone
  options(digits=4)
  data(veronica)
  ver.geo <- coord2dist(coordmatrix=veronica.coord[173:207,],file.format="decimal2")
  vei <- prabinit(prabmatrix=veronica[173:207,],distance="jaccard")
  loggeo <- log(ver.geo+quantile(as.vector(as.dist(ver.geo)),0.25))
  species <-c(rep(1,13),rep(2,22))
  rtest <- regeqdist(dmx=loggeo,dmy=vei$distmat,grouping=species,groups=c(1,2))
  print(rtest)
Run the code above in your browser using DataLab