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.
Arguments
- model
Parametric or nonparametric regression out obtained by
frfast
function.- der
Number which determines any inference process. By default
der
isNULL
. If this term is0
, the calculation is for the point which maximize the estimate. If it is1
it is designed for the first derivative and if it is2
, 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).
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)
#> $Estimation
#> Critical Lwr Upr
#> Level 1 23.34835 22.51261 NA
#>
#> $First_der
#> Critical Lwr Upr
#> Level 1 18.74334 18.11341 19.7849
#>
#> $Second_der
#> Critical Lwr Upr
#> Level 1 18.4501 NA NA
#>
critical(fit, der = 0)
#> Critical Lwr Upr
#> Level 1 23.34835 22.51261 NA
critical(fit, der = 1)
#> Critical Lwr Upr
#> Level 1 18.74334 18.11341 19.7849
critical(fit, der = 2)
#> Critical Lwr Upr
#> Level 1 18.4501 NA NA
# fit2 <- frfast(DW ~ RC : F, data = barnacle) # with interactions
# critical(fit2)
# critical(fit2, der = 0)
# critical(fit2, der = 1)
# critical(fit2, der = 2)