sm.sigma | R Documentation |
This function estimates the error standard deviation in nonparametric regression with one or two covariates.
sm.sigma(x, y, rawdata = NA, weights = rep(1, length(y)),
diff.ord = 2, ci = FALSE, model = "none", h = NA, ...)
x |
a vector or two-column matrix of covariate values. |
y |
a vector of responses. |
rawdata |
a list containing the output from a binning operation.
This argument is used by |
weights |
a list of frequencies associated with binned data.
This argument is used by |
diff.ord |
an integer value which determines first (1) or second (2) differencing in the estimation of sigma. |
ci |
a logical value which controls whether a confidence interval is produced. |
model |
a character variable. If this is set to |
h |
a vector of length two defining a smoothing parameter to be used in the test of constant variance. |
... |
other optional parameters are passed to the |
see the reference below.
a list containing the estimate and, in the two covariate case, a
matrix which can be used by the function sm.sigma2.compare
,
pseudo-residuals and, if appropriate, a confidence interval and
a p-value for the test of constant variance.
none.
Bock, M., Bowman, A.W. & Ismail, B. (2007). Estimation and inference for error variance in bivariate nonparametric regression. Statistics & Computing, to appear.
sm.sigma2.compare
## Not run:
with(airquality, {
x <- cbind(Wind, Temp)
y <- Ozone^(1/3)
group <- (Solar.R < 200)
sig1 <- sm.sigma(x[ group, ], y[ group], ci = TRUE)
sig2 <- sm.sigma(x[!group, ], y[!group], ci = TRUE)
print(c(sig1$estimate, sig1$ci))
print(c(sig2$estimate, sig2$ci))
print(sm.sigma(x[ group, ], y[ group], model = "constant", h = c(3, 5))$p)
print(sm.sigma(x[!group, ], y[!group], model = "constant", h = c(3, 5))$p)
print(sm.sigma2.compare(x[group, ], y[group], x[!group, ], y[!group]))
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.