powered by
Split residual sum of squares from normal linear regression
rssSplit(fit, df0 = max(1, floor(fit$df/10)), seed = -71407)
lm object
degrees of freedom for the smaller of the two residual sums of squares
random seed for constructing the basis vectors of the split
a two-dimensional vector of independent sums of squares
# NOT RUN { n<-30 ; p<-6 ; sigma2<-1.5 X<-matrix(rnorm(n*p),n,p) y<-X%*%rnorm(6) + sqrt(sigma2)*rnorm(n) ss<-rssSplit(lm(y~ -1+X)) df<-as.numeric( substring(names(ss),first=3)) ss/df # }
Run the code above in your browser using DataLab