sm.ancova | 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. Regression surfaces can also be compared in a test but a graphical display is not produced.
sm.ancova(x, y, group, h, model = "none", h.alpha = NA, weights=NA,
covar = diag(1/weights), ...)
x |
a vector or two-column matrix 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. If this is missing the method of smoothing parameter
selection specified by |
model |
a character variable which defines the reference model. The values
|
h.alpha |
the value of the smoothing parameter used when estimating the vertical separations of the curves under the parallelism model. If this is missing, it is set to 2 * r / n, where r denotes the range of the data and n the sample size. |
weights |
case weights; see the documentation of |
covar |
the (estimated) covariance matrix of y. The default value assumes
the data to be independent. Where appropriate, the covariance structure
of |
... |
other optional parameters are passed to the |
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. If a reference band has been requested, the upper and lower boundaries and their common evaluation points are also returned.
a plot on the current graphical device is produced, unless display="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
, sm.options
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.