scenario_uncertainty {UncDecomp} | R Documentation |
Scenario uncertainty(DEPRECATED)
Description
This function performs uncertainty decomposition by scenario based on the second order interaction ANOVA model. The uncertainty from interaction effect from two scenarios is divided equally and assigned to each scenario.
Usage
scenario_uncertainty(data, var_name, stages = setdiff(names(data),
var_name))
Arguments
data |
a data frame containing scenarios(factor or character) for each stages and the variable of interest(numeric). data should contain all combinations of scenarios. |
var_name |
the name of the variable of interest |
stages |
names of the stages of interest. |
Value
List of 4 elements
summary |
summary of uncertainties |
main_uncer |
list of which element is a vector of uncertainties from the main effects of scenarios in the corresponding stage |
int_uncer |
list of which element is a vector of uncertainties from the interaction effects of scenarios in the corresponding stage |
scenario_uncer |
list of which element is a vector of uncertainties of scenarios in the corresponding stage |
Examples
stage1 <- LETTERS[1:3]
stage2 <- LETTERS[1:2]
stage3 <- LETTERS[1:4]
y <- rnorm(3*2*4)
data <- expand.grid(stage1=stage1,
stage2=stage2,
stage3=stage3)
data <- cbind(data, y)
# scenario_uncertainty() is deprecated. Use UD_ANOVA_model()
# scenario_uncertainty(data,"y", names(data)[-4])