Training health impact: Difference between revisions

From Opasnet
Jump to navigation Jump to search
mNo edit summary
(→‎Explanations: the whole section is outdated and removed)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Costs and valuations]]
[[Category:Costs and valuations]]
[[Category:Opasnet training]]
[[Category:Opasnet training]]
[[Category:Contains R code]]
{{variable|moderator=Jouni|stub=Yes}}
{{variable|moderator=Jouni|stub=Yes}}


Line 9: Line 10:
== Answer ==
== Answer ==


<rcode  
<rcode graphics=1>
name="answer"
label="Run code"
graphics="1"
include="
page:Opasnet_(R_library)|name:answer|
page:Training_health_impact|name:formula|
page:Training_exposure|name:formula
"
variables="name:population|description:What is the size of the population|default:100000"
>


cat("Initiation successful. Now starting the model.\n")
library(OpasnetUtils)
library(ggplot2)


out <- make.ovariable(
objects.latest("Op_en5675", code_name = "initiate") # [[Training health impact]]
name        = "health.impact",
 
data        = fetch("Op_en5675"),
health_impact <- EvalOutput(health_impact)
formula      = formula.Op_en5675,
 
dependencies = dependencies.Op_en5675
oprint(summary(health_impact))
)


print(out)
ggplot(health_impact@output, aes(x = health_impactResult, colour = Year)) +
plot(out)
geom_density() +
facet_grid(Trait ~ Year) +
theme_grey(base_size = 24)


</rcode>
</rcode>
Line 39: Line 32:
===Data===
===Data===


<t2b index="Year,Observation" locations="Unit,Result,Description" unit="-">
<t2b index="Trait" obs="Result" desc="Description" unit="cases /(µg/m3) /a">
2012|cases/year|10 - 100|
Respiratory disease|20 - 30|
2020|cases/year|15 - 150|
</t2b>
</t2b>


===Formula===
===Dependencies===


<rcode
* [[Training exposure]]
name="formula"
label="Initiate functions"
>


erf <- data.frame(Unit = "RR per ug/m3", Result = 1.5)
===Calculations===


background <- 100 / 100000 # cases per 100000 person-years
<rcode label="Initiate ovariable" name="initiate">


dependencies.Op_en5675 <- data.frame(
library(OpasnetUtils)
Name = "",  
 
Identifier = c("Op_en5674", "", "", ""),  
health_impact <- Ovariable("health_impact",
Direction = "wide",  
dependencies = data.frame(Name = "exposure", Ident = "Op_en5674/initiate"), # [[Training exposure]] exposure
Result = c("exposure", "erf", "population", "background")
formula = function(...) {
ERF <- Ovariable("ERF", ddata = "Op_en5675") # [[Training health impact]]
colnames(ERF@data) <- gsub("[ \\.]", "_", colnames(ERF@data))
 
out <- exposure * ERF
 
return(out)
}
)
)


objects.store(health_impact)


formula.Op_en5675 <- function(x) {
cat("Ovariable health_impact saved.\n")
exposure  <- make.ovariable(fetch(x[1, "Identifier"]), name = "exposure")
erf        <- make.ovariable(fetch(x[2, "Result"]), name = "erf")
population <- make.ovariable(
data = fetch(x[3, "Result"]),
name = "population",
formula = function(x) {return(interpret("50000-150000"))},
dependencies = data.frame(Result = 0)
)
background <- make.ovariable(fetch(x[4, "Result"]), name = "background")
cases      <- population * background * exp(exposure * log(erf))
return(cases)
}


</rcode>
</rcode>
Line 90: Line 75:


==Related files==
==Related files==
{{mfiles}}

Latest revision as of 15:48, 24 March 2015



Question

What is the health impact in the Training assessment?

Answer

+ Show code

Rationale

Data

Training health impact(cases /(µg/m3) /a)
ObsTraitResultDescription
1Respiratory disease20 - 30

Dependencies

Calculations

+ Show code

See also

Materials and examples for training in Opasnet and open assessment
Help pages Wiki editingHow to edit wikipagesQuick reference for wiki editingDrawing graphsOpasnet policiesWatching pagesWriting formulaeWord to WikiWiki editing Advanced skills
Training assessment (examples of different objects) Training assessmentTraining exposureTraining health impactTraining costsClimate change policies and health in KuopioClimate change policies in Kuopio
Methods and concepts AssessmentVariableMethodQuestionAnswerRationaleAttributeDecisionResultObject-oriented programming in OpasnetUniversal objectStudyFormulaOpasnetBaseUtilsOpen assessmentPSSP
Terms with changed use ScopeDefinitionResultTool


Keywords

References


Related files