R/CQregression.R

Defines functions CQregression

Documented in CQregression

CQregression <-
function(db, ncomp) {
inter<-na.omit(db)

ols.model<-matrix(nrow=1, ncol= (ncomp))
for(i in 1:ncomp) {
ols<-lm(inter[,i+2]~inter$flow)
ols.model[1,i]<-summary(ols)$r.squared
rownames(ols.model)<-c("rsquared")
colnames(ols.model)<-c(names(db[3:(ncomp+2)]))
if (i==ncomp) break
}

return(ols.model)}

Try the RiverLoad package in your browser

Any scripts or data that you put into this service are public.

RiverLoad documentation built on Jan. 4, 2022, 5:07 p.m.