Learn R Programming

UStatBookABSC (version 1.0.0)

FitAndResiduals: Computes a linear regression fit and residuals on possibly multivariate responses

Description

Computes a linear regression fit and residuals on possibly multivariate responses

Usage

FitAndResiduals(Y, X, BetaHat)

Arguments

Y
a numeric matrix, to act as response
X
a numeric matrix, to act as covariates
BetaHat
a numeric matrix, to act as slope

Value

a list consisting of two vectors, the fitted values and residuals

Examples

Run this code
 ## Not run: 
#  DataY = cbind(CCU12_Precip$Precip, CCU12_Precip$TMax);
# DataX = cbind(rep(1, length(CCU12_Precip$Precip)), CCU12_Precip$TMin)			
# BetaHat.New = WLS(DataY, DataX)
# Results.New = FitAndResiduals(DataY, DataX, BetaHat.New);
#     		## End(Not run)


Run the code above in your browser using DataLab