UD_ANOVA_stage {UncDecomp} | R Documentation |
Stage-wise uncertainty based on the second order interaction ANOVA
Description
This function performs uncertainty decomposition by stage based on the second order interaction ANOVA model. The uncertainty from interaction effect from two stages is divided equally and assigned to each stage.
Usage
UD_ANOVA_stage(data, var_name, stages = setdiff(names(data), var_name))
Arguments
data |
a data frame containing models(factor or character) for each stages and the variable of interest(numeric). data should contain all combinations of models. |
var_name |
the name of the variable of interest |
stages |
names of the stages in the model. |
Value
List(UD_stage class) including uncertainties of stages, uncertainties from main effects, uncertainties from interaction, total uncertainty, names of stages.
Examples
set.seed(0)
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)
stages <- names(data)
data <- cbind(data, y)
UD_ANOVA_stage(data,"y", stages)
[Package UncDecomp version 1.0.1 Index]