rsq.sse {rsq}R Documentation

SSE-Based R-Squared

Description

The sum-of-squared-errors-based R^2 for generalized linear models.

Usage

rsq.sse(fitObj,adj=FALSE)

Arguments

fitObj

an object of class "lm" or "glm", usually, a result of a call to lm, glm, or glm.nb.

adj

logical; if TRUE, calculate the adjusted R^2.

Details

This version of R^2 was proposed by Efron (1978). It is calculated on the basis of the formula of the classical R^2.

Value

The R^2 or adjusted R^2.

Author(s)

Dabao Zhang, Department of Statistics, Purdue University

References

Efron, B. (1978) Regression and ANOVA with zero-one data: measures of residual variation. Journal of the American Statistical Association, 73: 113-121.

See Also

rsq, rsq.partial, pcor.

Examples

data(hcrabs)
attach(hcrabs)
y <- ifelse(num.satellites>0,1,0)
bnfit <- glm(y~color+spine+width+weight,family=binomial)
rsq.sse(bnfit)
rsq.sse(bnfit,adj=TRUE)

psfit <- glm(num.satellites~color+spine+width+weight,family=poisson)
rsq.sse(psfit)
rsq.sse(psfit,adj=TRUE)

# Effectiveness of Bycycle Safety Helmets in Thompson et al. (1989)
y <- matrix(c(17,218,233,758),2,2)
x <- factor(c("yes","no"))
tbn <- glm(y~x,family=binomial)
rsq.sse(tbn)
rsq.sse(tbn,adj=TRUE)

[Package rsq version 2.6 Index]