UD_ANOVA_model: Model-wise uncertainty based on the second order interaction...

Description Usage Arguments Value Examples

View source: R/UD_ANOVA_model.R

Description

This function performs uncertainty decomposition by model based on the second order interaction ANOVA model. The uncertainty from interaction effect from two models is divided equally and assigned to each model.

Usage

1
UD_ANOVA_model(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 of interest.

Value

List(UD_model class) including uncertainties of models, uncertainties from main effects, uncertainties from interaction, total uncertainty, names of stages and models

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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_model <- UD_ANOVA_model(data, "y", stages)
UD_ANOVA_model
UD_ANOVA_stage <- UD_model2stage(UD_ANOVA_model)
UD_ANOVA_stage

UncDecomp documentation built on Nov. 7, 2019, 5:09 p.m.