critical: Critical points of the regression function

View source: R/critical.R

criticalR Documentation

Critical points of the regression function

Description

This function draws inference about some critical point in the support of X which is associated with some features of the regression function (e.g., minimum, maximum or inflection points which indicate changes in the sign of curvature). Returns the value of the covariate x which maximizes the estimate of the function, the value of the covariate x which maximizes the first derivative and the value of the covariate x which equals the second derivative to zero, for each level of the factor.

Usage

critical(model, der = NULL)

Arguments

model

Parametric or nonparametric regression out obtained by frfast function.

der

Number which determines any inference process. By default der is NULL. If this term is 0, the calculation is for the point which maximize the estimate. If it is 1 it is designed for the first derivative and if it is 2, it returns the point which equals the second derivative to zero.

Value

An object is returned with the following elements:

Estimation

x value which maximize the regression function with their 95% confidence intervals (for each level).

First_der

x value which maximize the first derivative with their 95% confidence intervals (for each level).

Second_der

x value which equals the second derivative to zero with their 95% confidence intervals (for each level).

Author(s)

Marta Sestelo, Nora M. Villanueva and Javier Roca-Pardinas.

References

Sestelo, M. (2013). Development and computational implementation of estimation and inference methods in flexible regression models. Applications in Biology, Engineering and Environment. PhD Thesis, Department of Statistics and O.R. University of Vigo.

Sestelo, M., Villanueva, N.M., Meira-Machado, L., Roca-Pardinas, J. (2017). npregfast: An R Package for Nonparametric Estimation and Inference in Life Sciences. Journal of Statistical Software, 82(12), 1-27.

Examples

library(npregfast)
data(barnacle)

fit <- frfast(DW ~ RC, data = barnacle) # without interactions
critical(fit)
critical(fit, der = 0)
critical(fit, der = 1)
critical(fit, der = 2)

# fit2 <- frfast(DW ~ RC : F, data = barnacle) # with interactions
# critical(fit2)
# critical(fit2, der = 0)
# critical(fit2, der = 1)
# critical(fit2, der = 2)


npregfast documentation built on Sept. 2, 2022, 5:07 p.m.