twoway (version 0.6.2)

residuals.twoway: Extract residuals from a twoway object

Description

Extract residuals from a twoway object

Extract fitted values from a twoway object

Usage

# S3 method for twoway
residuals(object, nonadd = FALSE, ...)

# S3 method for twoway fitted(object, nonadd = FALSE, ...)

Arguments

object

A class="twoway" object

nonadd

If TRUE, the 1 degree of freedom term for non-additivity is subtracted from the additive residuals

...

other arguments (unused)

Value

A numeric matrix of residuals corresponding to the data supplied to twoway

A numeric matrix of fitted values corresponding to the data supplied to twoway

Examples

Run this code
# NOT RUN {
data(taskRT)
task.2way <- twoway(taskRT)
residuals(task.2way)
residuals(task.2way, nonadd=TRUE)

sum(residuals(task.2way)^2)               #  SSE for additive model
sum(residuals(task.2way, nonadd=TRUE)^2)  # SSPE, non-additive model
data(taskRT)
task.2way <- twoway(taskRT)
fitted(task.2way)
fitted(task.2way, nonadd=TRUE)

# }

Run the code above in your browser using DataCamp Workspace