xdistResdiff: Residual Differences for Near Replicates: Tabulate and Test

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

A test for the completeness of a linear regression model can be performed based on comparing the differences of residuals for pairs of observations that are close to each other to the estimated standard deviation of the

Usage

1
2
3
xdistResdiff(object, perc = c(3, 10, 80), trim = 0.1,
  nmax = 100, nsim = 100, out = "aggregate")
xdistResscale(x, perc = c(3, 10, 90), trim = 1/6)

Arguments

object

an object containing the result of fitting a linear model by regr

x

an object produced by xdistResdiff

perc

Percentage points to define distance classes

trim

Trimming proportion for calculating means of absolute residual differences

nmax

maximal number of observations to form pairs

nsim

number of simulations for determining the null distribution of test statistics

out

determines the value of xdistResdiff: if =="aggregate" (the default), the value will be produced by calling xdistResscale, otherwise, all x distances and respective residual differences will be returned.

Details

See package vignette.

Value

For xdistResdiff with out="aggregate" and xdistResscale, a matrix is returned with a row for each class of x distances and the columns

xdist

mean x distance

rdiff.mean

absolute differences of residuals for pairs of observations in the distance class, averaged over the class

rdiff.simmean

mean of (trimmed) means for simulated data

rdiff.se

standard error of (trimmed) means as obtained from simulation

The matrix carries along the following attributes:

perc

given argument perc

xd.classlim

the actual class limits corresponding to perc

trim

given argument trim

rdiff.grandmean

overall mean of absolute residual differences

p-values

p values for the classes as obtained from simulation, and p-value for the sum of squares statistic

class

The value has S3 class xdistResscale and matrix

.

If xdistResdiff with out different from "aggregate", then a data.frame is returned containing a row for each pair of observations and the columns

id1, id2

the labels of the two observations

xdist

the x distance between the two observations

resdiff

the difference of residuals for the two observations

The value has S3 class xdistResdiff and data.frame.

Author(s)

Werner A. Stahel, ETH Zurich

References

See package vignette.

See Also

plot.xdistResscale

Examples

1
2
3
4
5
6
7
8
data(d.blast)
rr <- regr(tremor~distance+charge, data=d.blast)
## an inadequate model!x
xdistResdiff(rr)
xdrd <- xdistResdiff(rr, out="all")
showd(xdrd[,1:10])
xdistResscale(xdrd)
## same as first call of  xdiffResdiff

regr0 documentation built on May 2, 2019, 4:52 p.m.