Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sm.binomial.bootstrap

Bootstrap goodness-of-fit test for a logistic regression model.


Description

This function is associated with sm.binomial for the underlying fitting procedure. It performs a Pseudo-Likelihood Ratio Test for the goodness-of-fit of a standard parametric logistic regression of specified degree in the covariate x.

Usage

sm.binomial.bootstrap(x, y, N = rep(1, length(x)), h, degree = 1,
        fixed.disp=FALSE, ...)

Arguments

x

vector of the covariate values

y

vector of the response values; they must be nonnegative integers.

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.

degree

specifies the degree of the fitted polynomial in x on the logit scale (default=1).

fixed.disp

if TRUE, the dispersion parameter is kept at value 1 across the simulated samples, otherwise the dispersion parameter estimated from the sample is used to generate samples with that dispersion parameter (default=FALSE).

...

additional parameters passed to sm.binomial.

Details

see Section 5.4 of the reference below.

Value

a list containing the observed value of the Pseudo-Likelihood Ratio Test statistic, its observed p-value as estimated via the bootstrap method, and the vector of estimated dispersion parameters when this value is not forced to be 1.

Side Effects

Graphical output representing the bootstrap samples is produced on the current graphical device. The estimated dispersion parameter, the value of the test statistic and the observed significance level are printed.

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

Examples

## Not run: sm.binomial.bootstrap(concentration, dead, N, 0.5, nboot=50)

sm

Smoothing Methods for Nonparametric Regression and Density Estimation

v2.2-5.6
GPL (>= 2)
Authors
Adrian Bowman and Adelchi Azzalini. Ported to R by B. D. Ripley <ripley@stats.ox.ac.uk> up to version 2.0, version 2.1 by Adrian Bowman and Adelchi Azzalini, version 2.2 by Adrian Bowman.
Initial release
2018-09-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.