Learn R Programming

sm (version 2.0-14)

sm.binomial: Nonparametric logistic regression

Description

This function estimates the regression curve using the local likelihood approach for a vector of binomial observations and an associated vector of covariate values.

Usage

sm.binomial(x, y, N = rep(1, length(y)), h, ...)

Arguments

x
vector of the covariate values
y
vector of the response values; they must be nonnegative integers not larger than those of N.
h
the smoothing parameter; it must be positive.
N
a vector containing the binomial denominators. If missing, it is assumed to contain all 1's.
...
other optional parameters are passed to the sm.options function, through a mechanism which limits their effect only to this call of the function; those relevant for this function are the following:
  • add
{ if graph
nbins
The number of bins used when binning operation is performed. If nbins=0, binning is not performed; if nbins=NA (default), binning is switched on when the number of design points exceeds 100. See the documentatio
ngrid
the number of points where the regression curve must be estimated (only used if eval.points is not given). Default: ngrid=25.
pch
plotting character of the raw observed frequency. Default: pch=1.
xlab
label of the x-axis. Default is the name of x object.
ylab
label of the y-axis. Default is Pr{}.

Value

  • A list containing vectors with the evaluation points, the corresponding probability estimates, the linear predictors, the upper and lower points of the variability bands (on the probability scale) and the standard errors on the linear predictor scale.

Side Effects

graphical output will be produced, depending on the value of the display parameter.

Details

see Sections 3.4 and 5.4 of the reference below.

References

Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.

See Also

sm.binomial.bootstrap, sm.poisson, sm.options, glm, binning

Examples

Run this code
# the next example assumes that all binomial denominators are 1's
sm.binomial(dose, failure, h=0.5)
# in the next example, (some of) the dose levels are replicated 
sm.binomial(dose, failure, n.trials, h=0.5)

Run the code above in your browser using DataLab