Training exposure: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(technical edits)
 
(14 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 ==


<t2b index="Year,Observation" locations="Unit,Result,Description" unit="-">
<rcode embed=1 graphics=1>
2012|ug/m3|1 - 2|
2020|ug/m3|10 - 11|
</t2b>


library(OpasnetUtils)
library(ggplot2)


<rcode
objects.latest("Op_en5674", code_name = "initiate")
name="answer"  
exposure
label="Run code"  
exposure <- EvalOutput(exposure) # for printing
include="
page:Object-oriented_programming_in_Opasnet|name:answer|
page:OpasnetBaseUtils|name:generic|
page:Training_exposure|name:formula
"
>


cat("Initiation successful. Now starting the model.\n")
oprint(summary(exposure)) # fashionable design


library(xtable)
ggplot(exposure@output, aes(x = exposureResult, weight = 1, fill = Year)) +
out <- op_baseGetData("opasnet_base", "Op_en5674") # Downloads the data on the data table of this page.
geom_density() +
colnames(out)[colnames(out) == "obs.1"] <- "Row" # Changes the column name "obs.1" to "Row"
theme_grey(base_size = 24)
out <- tidy(out , direction = "wide")
print(out)
colnames(out)[colnames(out) == "result"] <- "Result"
out <- make.ovariable(
data = out,
formula = formula.Op_en5674,
dependencies = dependencies.Op_en5674)
cat("Computing training exposures.\n")
print(out)


</rcode>
</rcode>


{{attack|# |The automatic Obs column creates a column "obs.1" in Opasnet Base; it should replace "Obs" instead.|--[[User:Jouni|Jouni]] 22:15, 14 May 2012 (EEST)}}
== Rationale ==
 
===Data===
 
<t2b index="Exposure agent,Year" obs="Result" desc="Description" unit="µg /m3">
PM2.5|2012|1 - 4|
PM2.5|2020|10 - 11|
</t2b>
 
=== Calculations ===


{{attack|# |The column name is "result" although it should be "Result". This should be converted automatically but now it is done by hand in the code.|--[[User:Jouni|Jouni]] 22:15, 14 May 2012 (EEST)}}
<rcode label="Initiate ovariable" name="initiate">


== Rationale ==
library(OpasnetUtils) # relevant libraries


=== Formula ===
# Define ovariable


<rcode
exposure <- Ovariable("exposure", ddata = "Op_en5674")
name="formula"  
colnames(exposure@data) <- gsub("[ \\.]", "_", colnames(exposure@data))
label="Initiate functions"  
include="
page:Object-oriented_programming_in_Opasnet|name:answer|
page:OpasnetBaseUtils|name:generic
"
>


dependencies.Op_en5674 <- list(
objects.store(exposure) # save for later use
microenvironment.concentration = data.frame(
Microenvironment = c("Home", "Other"),
Unit = "ug/m3",
Result = c(1, 2)),
microenvironment.time = data.frame(
Microenvironment = c("Home", "Other"),
Unit = "ug/m3",
Result = c(0.7, 0.3))
)


formula.Op_en5674 <- function(x) {
cat("Ovariable exposure saved.\n")
ueConc <- make.ovariable(x$microenvironment.concentration)
ueTime <- make.ovariable(x$microenvironment.time)
out <- ueConc * ueTime
out <- tapply(out, out@sample[c("Iter", "Unit")], sum)
return(out)
}


</rcode>
</rcode>
Line 82: Line 55:
==See also==
==See also==


{{training assessment}}
{{Opasnet training}}


==Keywords==
==Keywords==
Line 91: 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