sm.ancova {sm} | R Documentation |
This function allows a set of nonparametric regression curves to be compared, both graphically and formally in a hypothesis test. A reference model, used to define the null hypothesis, may be either equality or parallelism.
sm.ancova(x, y, group, h, display="lines", model="none", band=T, test=T, h.alpha=(2 * diff(range(x)))/length(x), ngrid=50, eval.points=NA, xlab, ylab, ...)
x |
a vector of covariate values. |
y |
a vector of response values. |
group |
a vector of group indicators. |
h |
the smoothing parameter to be used in the construction of each of the regression curves. |
display |
any character setting other than "none" will cause a plot of the curves,
distinguished by line type, to be produced.
|
model |
a character variable which defines the reference model. The values
"none" , "equal" and "parallel" are possible.
|
band |
a logical flag controlling the production of a reference band for the reference model. A band will be produced only in the case of two groups. |
test |
a logical flag controlling the production of a formal test, using the reference model as the null hypothesis. |
h.alpha |
the value of the smoothing parameter used when estimating the vertical separations of the curves under the parallelism model. |
ngrid |
the size of the grid used to plot the curves. |
eval.points |
a vector of points at which reference bands will be evaluated. |
xlab |
the label attached to the x-axis. |
ylab |
the label attached to the y-axis. |
... |
additional graphical parameters. |
see Sections 6.4 and 6.5 of the book by Bowman & Azzalini, and the papers by Young & Bowman listed below. This function is a developed version of code originally written by Stuart Young.
a list containing an estimate of the error standard deviation and, where appropriate, a p-value and reference model. If the parallelism model has been selected then a vector of estimates of the vertical separations of the underlying regression curves is also returned.
none.
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.
Young, S.G. and Bowman, A.W. (1995). Nonparametric analysis of covariance. Biometrics 51, 920-931.
Bowman, A.W. and Young, S.G. (1996). Graphical comparison of nonparametric curves. Applied Statistics 45, 83-98.
sm.regression
, sm.density.compare
x <- runif(50, 0, 1) y <- 4*sin(6*x) + rnorm(50) g <- rbinom(50, 1, 0.5) sm.ancova(x, y, g, h = 0.15, model = "equal")