Learn R Programming

sensitivity (version 1.3-1)

srcpcc: Linear Sensitivity Analysis

Description

srcpcc computes the standardized regression coefficients (SRC) and the partial correlation coefficients (PCC). Analysis can be done on the ranks; then the indices are the standardized rank regression coefficients (SRRC) and the partial rank correlation coefficients (PRCC).

Usage

srcpcc(model = NULL, x, pcc = TRUE, rank = FALSE,
      nboot = 0, conf = 0.95, ...)

Arguments

model
the model
x
the input sample
pcc
logical. If TRUE, the P(R)CCs are computed
rank
logical. If TRUE, the analysis is done on the ranks
nboot
the number of bootstrap replicates
conf
the confidence level for bootstrap confidence intervals
...
any other arguments for model which are passed unchanged each time it is called

Value

  • srcpcc returns an object of class "srcpcc". An object of class "srcpcc" is a list containing the following components:
  • ythe response
  • srcthe estimations of the SRC indices (or SRRC if rank analysis is requested)
  • pccif requested, the estimations of the PCC indices (or PRCC if rank analysis is requested)

Computational cost

The number of model evaluations is $n$ where $n$ is the size of the sample x.

Details

model is a function or a predictor (a class with a predict method) computing the response y based on the sample given by x. If no model is specified, the indices will be computed when one gives the response.

References

Saltelli, A., Chan, K. and Scott, E. M., 2000, Sensitivity analysis, Wiley.

Examples

Run this code
# linear model : Y = X1 + X2 + X3

model1 <- function(x) x[, 1] + x[, 2] + x[, 3]

# a 100-sample with X1 ~ U(0.5, 1.5)
#                   X2 ~ U(1.5, 4.5)
#                   X3 ~ U(4.5, 13.5)

n <- 100
x <- data.frame(X1 = runif(n, 0.5, 1.5),
                X2 = runif(n, 1.5, 4.5),
                X3 = runif(n, 4.5, 13.5))

# sensitivity analysis

sa <- srcpcc(model = model1, x = x, nboot = 100)
print(sa)
par(mfrow = c(1,2))
plot(sa, ask = FALSE)

Run the code above in your browser using DataLab