Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


rsq (version 0.6)

qvresidual: Residual Defined on the Basis of a Quardratic Variance Function

Description

Calculate the residual for given observed y and its fitted value yfit, i.e. the distance between them along the quardratic variance function: $V(\mu) = v_2*\mu^2+v_1*\mu+v_0$.

Usage

qvresidual(y,yfit,v2,v1)

Arguments

y
observed value;
yfit
fitted value;
v2
$v_2$;
v1
$v_1$.

Value

Details

This is an internal function called by another internal function vresidualand vresidual.nb.

References

Zhang, D. (2016). A coefficient of determination for generalized linear models. The American Statistician, tentatively accepted.

Examples

Run this code
# Variance function of binomial distribution: V(mu)=mu*(1-mu)
v2 <- -1
v1 <- 1
y <- 0
yfit <- 0.5
vr <- qvresidual(y,yfit,v2,v1)
vr

Run the code above in your browser using DataLab