Learn R Programming

sm (version 2.2-6.0)

sm.poisson.bootstrap: Bootstrap goodness-of-fit test for a Poisson regression model

Description

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

Usage

sm.poisson.bootstrap(x, y, h,  degree = 1,
          fixed.disp = FALSE, intercept = TRUE, ...)

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.

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.

degree

specifies the degree of the fitted polynomial in x on the logarithm 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).

intercept

TRUE (default) if an intercept is to be included in the fitted model.

...

additional parameters passed to sm.poisson.

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.

Details

see Section 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.poisson, sm.binomial.bootstrap

Examples

Run this code
## takes a while: extend sm.script(muscle)
with(muscle, {
   TypeI <- TypeI.P + TypeI.R + TypeI.B
   sm.poisson.bootstrap(log(TypeI), TypeII, h = 0.5)
})

Run the code above in your browser using DataLab