Training assessment/Decisions: Difference between revisions
Jump to navigation
Jump to search
(basic structure updated, now updating decisions.apply) |
(→Answer: doesn't work yet) |
||
| Line 30: | Line 30: | ||
> | > | ||
# DECISIONS | # APPLY.DECISIONS ############## apply.decisions takes a decision table and applies that to an assessment. | ||
## dec is a decision data.frame that must have columns Decision, Option, Variable, Cell, Change, Result. It can have several variables. | ## dec is a decision data.frame that must have columns Decision, Option, Variable, Cell, Change, Result. It can have several variables. | ||
decisions | apply.decisions <- function(assessment) { | ||
dec <- merge(assessment@decisions, assessment@dependencies, by.x = "Variable", by.y = "Name") | dec <- merge(assessment@decisions, assessment@dependencies, by.x = "Variable", by.y = "Name") | ||
print(dec) | colnames(dec)[colnames(dec) == "Result.x"] <- "Result" | ||
colnames(dec)[colnames(dec) == "Result.y"] <- "Name" | |||
print(xtable(dec), type = 'html') | |||
# out <- as.list(unique(dec$Name)) | |||
# names(out) <- as.character(unique(dec$Name)) | |||
for(variables in unique(dec$ | for(variables in unique(dec$Name)) { # Take one variable at a time. | ||
dec.var <- dec[dec$ | dec.var <- dec[dec$Name == variables, ] # dec.var = variable-specific decisions | ||
print(xtable(dec.var), type = 'html') | |||
scenarios <- data.frame(temp = 1) | scenarios <- data.frame(temp = 1) | ||
| Line 48: | Line 51: | ||
scenarios <- merge(scenarios, temp) | scenarios <- merge(scenarios, temp) | ||
} | } | ||
print(scenarios) | |||
var <- assessment@vars[[as.character(dec.var$Name[1])]] | |||
var <- merge(scenarios[colnames(scenarios) != "temp"], var) | var <- merge(scenarios[colnames(scenarios) != "temp"], var) | ||
print(var) | |||
for(s in 1:nrow(dec.var)) { # Each row in decision handled separately | for(s in 1:nrow(dec.var)) { # Each row in decision handled separately | ||
cell <- gsub("^[ \t]+|[ \t]+$", "", as.character(dec$Cell[s])) # Leading and trailing whitespaces removed. | cell <- gsub("^[ \t]+|[ \t]+$", "", as.character(dec$Cell[s])) # Leading and trailing whitespaces removed. | ||
| Line 72: | Line 74: | ||
} | } | ||
assessment@vars[[variables]] <- var | |||
} | } | ||
return( | return(assessment) | ||
} | } | ||
| Line 81: | Line 83: | ||
assessment.training <- make.oassessment("Op_en5677") | assessment.training <- make.oassessment("Op_en5677") | ||
assessment.training <- apply.decisions(assessment.training) | |||
decisions | |||
</rcode> | </rcode> | ||
Revision as of 11:00, 27 May 2012
| Moderator:Jouni (see all) |
|
|
| Upload data
|
Training decision describes decision options for an imaginary assessment designed for training.
Question
What are plausible policies for the Training assessment?
Answer
| Obs | Decision | Option | Variable | Cell | Change | Unit | Amount | Description |
|---|---|---|---|---|---|---|---|---|
| 1 | Exposure policy | Reduce exposure | Training exposure | Year: 2012 | Multiply | - | 0.5 | |
| 2 | Health promotion | Reduce background risk | Training health impact | Multiply | - | 0.9 | ||
| 3 | Health promotion | Promotion budget reduced | Training health impact | Multiply | - | 1.1 |
Rationale
See also
| Help pages | Wiki editing • How to edit wikipages • Quick reference for wiki editing • Drawing graphs • Opasnet policies • Watching pages • Writing formulae • Word to Wiki • Wiki editing Advanced skills |
| Training assessment (examples of different objects) | Training assessment • Training exposure • Training health impact • Training costs • Climate change policies and health in Kuopio • Climate change policies in Kuopio |
| Methods and concepts | Assessment • Variable • Method • Question • Answer • Rationale • Attribute • Decision • Result • Object-oriented programming in Opasnet • Universal object • Study • Formula • OpasnetBaseUtils • Open assessment • PSSP |
| Terms with changed use | Scope • Definition • Result • Tool |
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>