sm.density.compare {sm} | R Documentation |
This function allows a set of univariate density estimates to be compared, both graphically and formally in a permutation test of equality.
sm.density.compare(x, group, h, model = "none", ...)
x |
a vector of data. |
group |
a vector of group labels. |
h |
the smoothing parameter to be used in the construction of each density estimate. Notice that the same smoothing parameter is used for each group. If this value is omitted, the mean of the normal optimal values for the different groups is used. |
model |
the default value is |
... |
other optional parameters are passed to the |
see Section 6.2 of the reference below.
When model
is set to "none"
, nothing is returned. When
"model"
is set to "equal"
, a list containing the smoothing
parameter and the p-value of the test is returned. When band
takes the value TRUE
, and there are only two groups to compare,
the list contains in addition the upper and lower end-points of the reference
band for equality.
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.
sm.density
, sm.ancova
, sm.options
y <- rnorm(100) g <- rep(1:2, rep(50,2)) sm.density.compare(y, g, model="equal")