LOO.prednError: Calculates the leave-one-out prediction sums of squares of a...

Description Usage Arguments Value Examples

View source: R/SplineCAP.R

Description

Calculates the leave-one-out prediction sums of squares of a multivariate linear regression

Usage

1
LOO.prednError(f.object)

Arguments

f.object

Model formula

Value

A list containing residual sums of squares and leave-one-out prediction sums of squares

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(PitTraps)
Locn=PitTraps$Locn
distance=PitTraps$distance
Counts=PitTraps[,-c(1,2)]

B=bSpline(distance,degree=2,df=5)   #Spline basis for distance
First need to calculate PCOs, as these are the Y variables
D=as.matrix(vegdist(Counts>0)) #Bray-Curtis is default in vegdist
Y.pco=cmdscale(D,k=nrow(D)-1,eig=T)$points #The PCOs
LOO.prednError(Y.pco~B+Locn)

rbmillar/SplineCAP documentation built on Feb. 20, 2021, 6:40 a.m.