Testing equality of two distance-regressions
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 class 'regeqdist' print(x,...)
dmx |
dissimilarity matrix or object of class
|
dmy |
dissimilarity matrix or object of class
|
grouping |
something that can be coerced into a factor,
defining the grouping of
objects represented by the dissimilarities |
groups |
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 |
x |
object of class |
... |
optional arguments for print method. |
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).
list of class "regeqdist"
with components
pval |
p-values for intercept and slope. |
coeffdiff |
vector of differences between groups (first minus second) for intercept and slope. |
condition |
condition numbers of regressions, see |
lmfit |
list. Output objects of |
jr |
list of two lists of two; output object of
|
xcenter |
mean of |
tstat |
t-statistic. |
tdf |
vector of degrees of freedom of t-statistic according to Welch-Sattertwaithe approximation for intercept and slope. |
jackest |
jackknife-estimator of difference between regressions; vector with intercept and slope difference. |
jackse |
vector with jackknife-standard errors for
|
jackpseudo |
list of two lists of vectors; jacknife pseudovalues within both groups for intercept and slope estimators. |
groups |
see above. |
Hausdorf, B. and Hennig, C. (2019) Species delimitation and geography. Submitted.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.