segLoadReg: Load Estimation

Description Usage Arguments Details Value References See Also Examples

View source: R/segLoadReg.R

Description

Build a segmented rating-curve (regression) model for river load estimation.

Usage

1
2
3
segLoadReg(formula, data, subset, na.action, flow, dates, flow.units = "cfs",
  conc.units = "", load.units = "kg", time.step = "day", station = "",
  trace = TRUE)

Arguments

formula

a formula describing the regression model. See Details.

data

the data to search for the variables in formula.

subset

an expression to select a subset of the data.

na.action

what to do with missing values.

flow

character string indicating the name of the flow column.

dates

character string indicating the name of the date column.

flow.units

character string describing the flow unit.

conc.units

character string describing the concentration unit.

load.units

character string describing the load unit.

time.step

character string describing the time step of the calibration data.

station

character string description of the station.

trace

if logical, then if TRUE print a short summary of the segmented fit. Otherwise a character string and the segmented model is saved as that object name.

Details

The left-hand side of the formula can be any numeric variable, just as with lm or a variable of class "lcens," "mcens," "qw," or "Surv." The response variable must be a column in data; it cannot be constructed using as.lcens, as.mcens, or Surv. The initial segmented model is based on uncensored data—simple substitution of 1/2 the reporting limit is used for left-censored values and multiply censored values cause the analysis to fail.

The first term of right-hand side must be defined by the seg function with the number of segments. The first term may be followed by any number of additional terms. The final model will place the segmeted term in the last postition and seg will be replaced by the proper call to segment.

Value

An object of class "loadReg."

References

will need some.

See Also

censReg, link{seg}, segment

Examples

1
2
3
4
5
6
# From application 1 in the vignettes
data(app1.calib)
app1.lr <- loadReg(Phosphorus ~ model(1), data = app1.calib, 
 flow = "FLOW", dates = "DATES", conc.units="mg/L",
 station="Illinois River at Marseilles, Ill.")
print(app1.lr)

USGS-R/rloadest documentation built on Oct. 2, 2020, 5:21 a.m.