WREG.WLS: Weighted-Multiple-Linear Regression Program (WREG)

Description Usage Arguments Details Value Examples


The WREG.WLS function executes the multiple linear regression analysis using weighted least-squares regression.


WREG.WLS(Y, X, recordLengths, LP3, transY, x0 = NA)



A numeric vector of the dependent variable of interest, with any transformations already applied.


A numeric matrix of the independent variables in the regression, with any transformations already applied. Each row represents a site and each column represents a particular independe variable. (If a leading constant is used, it should be included here as a leading column of ones.) The rows must be in the same order as the dependent variables in Y.


A numeric vector whose rows are in the same order as Y and represent the at-site record length.


A numeric matrix containing the fitted Log-Pearson Type III standard deviate, standard deviation and skew for each site. The columns of the matrix represent S, K, G, and an option regional skew value GR required by WREG.GLS with regSkew = TRUE. The order of the rows must be the same as Y.


A required character string indicating if the the dependentvariable was transformed by the common logarithm ('log10'), transformed by the natural logarithm ('ln') or untransformed ('none').


A vector containing the independent variables (as above) for a particular target site. This variable is only used for ROI analysis.


In this implementation, the weights for weighted least-squares regression are defined by record lengths. See manual for details.


All outputs are returned as part of a list. The elements of the list depend on the type of regression performed. The elements of the list may include:


A data frame composed of four variables: (1) Coefficient contains the regression coefficeints estimated for the model, (2) Standard Error contains the standard errors of each regression coefficient, (3) tStatistic contains the Student's T-statistic of each regression coefficient and (4) pValue contains the significance probability of each regression coefficient.


A data frame composed of three variables for each site in the regression. Residual contains the model residuals. Leverage contains the leverage of each site. Influence contains the influence of each site.


The critical value of leverage. See Leverage


The critical value of influence. See Influence


A logical matrix indicating if the leverage (column 1) is significant and the influence (column 2) is significant for each site in the regression.


A list of not more than ten elements. All regression types return the mean squared error of residuals (MSE), the coefficient of determination (R2), the adjusted coefficient of determination (R2_adj) and the root mean squared error (RMSE, in percent). The pseudo coefficient of regression (R2_pseudo), the average variance of prediction (AVP), the standard error of prediction (Sp, in percent), a vector of the individual variances of prediction for each site (VP.PredVar), the model-error variance (ModErrVar) and the standardized model error variance (StanModErr, in percent) are also returned. Details on the appropriateness and applicability of performance metrics can be found in the WREG manual.


The input predictors.


The input observations.


A vector of model estimates from the regression model.


A vector of model residuals.


The weighting matrix used to develop regression estimates.


A list of input parameters for error searching. Currently empty.


# Import some example data

USGS-R/WREG documentation built on May 9, 2019, 6:48 p.m.