Training exposure: Difference between revisions

From Opasnet
Jump to navigation Jump to search
mNo edit summary
 
(10 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 embed=1 graphics=1>
name="answer"
label="Run code"
graphics="1"
include="
page:Opasnet_(R_library)|name:answer|
page:Training_exposure|name:formula"
>


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


out <- make.ovariable(
objects.latest("Op_en5674", code_name = "initiate")
name        = "exposure",
exposure
data        = fetch("Op_en5674"),
exposure <- EvalOutput(exposure) # for printing
formula      = formula.Op_en5674,
dependencies = dependencies.Op_en5674
)


out
oprint(summary(exposure)) # fashionable design
print(out, iter = 1:5)
 
plot(out)
ggplot(exposure@output, aes(x = exposureResult, weight = 1, fill = Year)) +
geom_density() +
theme_grey(base_size = 24)


</rcode>
</rcode>
Line 37: Line 31:
===Data===
===Data===


<t2b index="Year,Observation" locations="Unit,Result,Description" unit="-">
<t2b index="Exposure agent,Year" obs="Result" desc="Description" unit="µg /m3">
2012|ug/m3|1 - 2|
PM2.5|2012|1 - 4|
2020|ug/m3|10 - 11|
PM2.5|2020|10 - 11|
</t2b>
</t2b>


=== Formula ===
=== Calculations ===


<rcode  
<rcode label="Initiate ovariable" name="initiate">
name="formula"
label="Initiate functions"  
include="page:Opasnet_(R_library)|name:answer"
graphics="1"
>


microenvironment.concentration <- data.frame(
library(OpasnetUtils) # relevant libraries
Microenvironment = c("Home", "Other"),
Unit = "ug/m3",
Result = c("1-2", "6-8")
)


microenvironment.time <- data.frame(
# Define ovariable
Microenvironment = c("Home", "Other"),
Unit = "fraction",
Result = c(0.7, 0.3)
)


dependencies.Op_en5674 <- data.frame(
exposure <- Ovariable("exposure", ddata = "Op_en5674")
Name = "",  
colnames(exposure@data) <- gsub("[ \\.]", "_", colnames(exposure@data))
Identifier = "",
Direction = "",
Result = c("microenvironment.concentration", "microenvironment.time")
)


objects.store(exposure) # save for later use


formula.Op_en5674 <- function(x) {
cat("Ovariable exposure saved.\n")
out <- make.ovariable(fetch(x[1, "Result"])) * make.ovariable(fetch(x[2, "Result"]))
out <- tapply(out, out@sample[c("Iter", "Unit")], sum)
return(out)
}


</rcode>
</rcode>
Line 90: Line 64:


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

Latest revision as of 08:18, 3 June 2015



Question

What is the exposure in the Training assessment?

Answer

+ Show code

Rationale

Data

Training exposure: Difference between revisions(µg /m3)
ObsExposure agentYearResultDescription
1PM2.520121 - 4
2PM2.5202010 - 11

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