1 1 2 0 0 ktluser 21. Novta 2008 19:08 ktluser 7. Marta 2009 22:52 48,24 1,5,9,346,194,17 Arial, 15 0,Model Open_assessment_func,2,2,0,1,C:\temp\Open_assessment_functions.ANA Population by country Table(Country)( 61.875822M,82.2178M,45.200737M) 56,32,1 48,24 2,577,314,416,303,0,MIDM 2,5,334,307,146,0,MIDM 65535,52427,65534 2,I,4,2,0,0,4,0,$,0,"ABBREV",0 Area ['Paris','Non-Paris France','Berlin','Bavaria','England','Wales'] 56,152,1 48,12 ['Paris','Non-Paris France','Berlin','Bavaria','England','Wales'] Country ['France','Germany','Spain'] 56,64,1 48,12 2,D,4,2,0,0,4,0,$,0,"ABBREV",0 ['France','Germany','Spain'] (data;in1, in2:indextype; weight; marginal:optional; aggregation:= 'sum') ICF Index conversion function. * Data: variable to be converted into another index. * In1: index to be converted from. Must be an index of Data. * In2: index to be converted to. This is only needed if the default marginal is used. * Weight: the weighting parameter. Must be indexed by both In1 and In2. * Marginal: The Data variable may have boundaries along In1 wider than In2. In this case, marginal is the total of the Weight with the same boundaries along In1 as Data. If the boundaries of In1 and In2 are the same, marginal is equal to sum(Weight,In2). * Aggregation: There are three ways to aggregate data along In1. ** Sum (default): In1 is simply summed up. This can be done when the data is exclusive and mutually exhaustive, and the combined amount in any two cells together is the sum of each cell separately. ** Average: This is used e.g. for concentrations, as the concentration in two merged cells is a weighted average of the concentrations in the individual cells. ** Sample: This is used for disaggregation. If the cells are exclusive, this does not have an effect. However, if there are overlapping cells, data is randomly samped from all of them. <a href="http://en.opasnet.org/w/Index_conversion_function">Wiki description</a> if isnotspecified(marginal) then marginal:= sum(weight,in2); var a:= if textuppercase(weight)='REST' then 0 else weight; weight:= if textuppercase(weight)='REST' then marginal-sum(a,in2) else a; a:= data*weight/marginal; if textuppercase(aggregation)='SUM' then a:= sum(a,in1); if textuppercase(aggregation)='AVERAGE' then a:= sum(a,in1)/sum(weight/marginal,in1); if textuppercase(aggregation)='SAMPLE' then ( var b:= if a=0 then 0 else 1; b:= if sum(b,in1)=0 then b+1 else b; a:= chancedist(b,a,in1)); a 192,120,1 48,12 2,666,25,572,516 data,in1,in2,weight,marginal,aggregation Population by area var marginal:= if country='France' then 1 else Population_by_countr; icf(Population_by_countr,Country, area1, Population_weight, marginal) 200,32,1 48,24 2,373,26,279,199,0,MIDM [Country,Area1] 2,D,4,2,0,0,4,0,$,0,"ABBREV",0 Population weight Table(Country,Area1)( 0.035,0.965,0,0,0,0, 0,0,3.4163M,12.522M,'rest',0, 0,0,0,0,0,0 ) 56,120,1 48,24 2,337,294,317,209,0,MIDM 2,323,292,330,195,0,MIDM 65535,52427,65534 [Country,Area1] [Country,Area1] 2,D,4,2,0,0,4,0,$,0,"ABBREV",0