Learn R Programming

npsm (version 2.0.0)

polydeg: Degree of Polynomial Determination

Description

Tests for the degree of a polnomial. This test was suggested by Graybill (1976) and is discussed from a robust point-of-view in Section 4.7.1. of Kloke and McKean (2014)/4.6.1 of Kloke and McKean (2024).

Usage

polydeg(y, x, P, alpha = 0.05)

Value

deg

The determined degree

coll

Matrix of step information

fitf

Fit of the polynomial based on the determoned degreer

Arguments

y

vector of responses

x

Predictor

P

Super degree of polynomial which provides a satisfactory fit

alpha

Level of the testing

Details

Returns the degree of the polynomial based on the algorithm.

References

Graybill, F.A. (1976), Theory and application of the linear model, North Scituate, Ma: Duxbury Press.

Kloke, J. and McKean, J.W. (2014), Nonparametric statistcal methods using R, Boca Raton, FL: Chapman-Hall. Kloke, J. and McKean, J.W. (2024), Nonparametric statistcal methods using R, Second Edition, Boca Raton, FL: Chapman-Hall.

Examples

Run this code
 x <- 1:20
 xc <- x - mean(x)
 y<- .2*xc + xc^3 +rt(20,3)*90
 plot(y~x)
 polydeg(y,xc,6)

Run the code above in your browser using DataLab