uwIntroStats (version 0.0.7)

uResiduals: Extract Residuals from uRegress objects

Description

Extracts residuals (unstandardized, standardized, studentized, or jackknife) from uRegress objects.

Usage

uResiduals(object, type="", version=FALSE)

Arguments

object

an object of class uRegress, as returned by regress.

type

denotes the type of residuals to return. Default value is "", which returns unstandardized residuals. "standardized", "studentized", and "jackknife" return the expected type of residuals.

version

if TRUE, the version of the function will be returned. No other computations will be performed.

Value

Returns the type of residuals requested.

Details

Relies on functionality from the stats package to return residuals from the uRegress object. "studentized" residuals are computed as internally studentized residuals, while "jackknife" computes the externally studentized residuals.

See Also

regress, rstudent, rstandard

Examples

Run this code
# NOT RUN {
# Load required libraries
library(survival)

# Reading in a dataset
mri <- read.table("http://www.emersonstatistics.com/datasets/mri.txt",header=TRUE)

# Create a uRegress object, regressing ldl on age
ldlReg <- regress("mean", age~ldl, data=mri)

# Get the studentized residuals
uResiduals(ldlReg, "studentized")

# Get the jackknifed residuals
uResiduals(ldlReg, "jackknife")
# }

Run the code above in your browser using DataLab