Description Usage Arguments Details Value Examples
The Influence
function calculates the influence statistics
(Cooks-D) for any regrerssion.
1 |
e |
contains the model residuals. |
X |
contains independent variables. A leading constant of one is included if a constant is included in the regression. Each row represents a unique obsevation. |
Omega |
is the weighting matrix used for regression fitting. |
Beta |
contains the fitted model coefficients. |
ROI |
is a logical indicating if this is a region-of-influence regression. |
Lev |
is a vector with the same length as |
Influence is a measure of the impact each observation has on the estimated regression coefficients. The calculation is based on equation 43 of the WREG v. 1.0 manual. The critical value of influence is calculated using equation 44. An influence is considered significant if the absolute value of the influence is greater than the critical value.
For region-of-influence regressions, the influence calculation is weighted by the leverage of that observation on the target site and the overall leverage of the observation. This is a departure from the WREG v. 1.0, but reflects the WREG v. 1.05 code.
The function returns as list as output. The list contains:
Influence |
A vector containing the influence (Cook's D) of each observation on the estimated regression coefficients. |
Limit |
The critical influence value for this dataset. |
Significant |
A logical
vector the same size as |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Import some example data
peakFQdir <- paste0(
file.path(system.file("exampleDirectory", package = "WREG"),
"pfqImport"))
gisFilePath <- file.path(peakFQdir, "pfqSiteInfo.txt")
importedData <- importPeakFQ(pfqPath = peakFQdir, gisFile = gisFilePath)
# Run a simple regression
Y <- importedData$Y$AEP_0.5
X <- importedData$X[c("Sand", "OutletElev", "Slope")]
transY <- "none"
result <- WREG.OLS(Y, X, transY)
# calculate influence of each point
influenceResult <- Influence(e = result$residuals, X = X,
Omega = result$Weighting, Beta = result$Coefs$Coefficient)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.