Learn R Programming

RiverLoad (version 1.0.3)

rsquared.period: Coefficient of determination for period based regression analyses

Description

Return the coefficient of determination (R^2) to inspect the relationship between concentration and flow. It is a useful tool for the function rating.period and ferguson.period.

Usage

rsquared.period(db, ncomp, period)

Arguments

db

An input data frame with at least three column. A column with DateTime in standard format (yyyy-mm-dd HH:MM:SS) labeled "datetime", a column with flow records in cubic meter per second labeled "flow", and columns with scattered concentration data in milligram per litre. Alternatively, it can be used the output matrix of the function db.union.

ncomp

Number of compounds in the input data frame for which the load must be estimated.

period

A mandatory argument that specify the time period in which the regression relationship must be calculated. It can be "month" for a monthly estimation of load, or it can be "year" for annual estimation of load.

Value

A matrix with the R^2 value for the different compiunds.

See Also

db.union rating.period ferguson.period

Examples

Run this code
# NOT RUN {
data("flow.data3","conc.data3")
union<-db.union(flow.data3, conc.data3)
rsquared.period(union,1, "month")
rsquared.period(union,1, "year")
# }

Run the code above in your browser using DataLab