This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
howtos:toolcoding:using_a_relative_propensity [2010/11/12 20:59] shona.weldon |
howtos:toolcoding:using_a_relative_propensity [2010/11/12 21:06] shona.weldon |
||
---|---|---|---|
Line 17: | Line 17: | ||
Finally the math to calculate peoplePerHousehold[uss,usdt,th] is: | Finally the math to calculate peoplePerHousehold[uss,usdt,th] is: | ||
+ | !Equation A: | ||
local peoplePerHouseholdEst[uss,usdt,th] = households[uss,usdt,th] * peoplePerHousehold[usdt] | local peoplePerHouseholdEst[uss,usdt,th] = households[uss,usdt,th] * peoplePerHousehold[usdt] | ||
+ | !Equation B: | ||
peoplePerHousehold[uss,usdt,th] = population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] * relPopPersPerHH[usdt] | peoplePerHousehold[uss,usdt,th] = population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] * relPopPersPerHH[usdt] | ||
+ | ===== Check your above equation through symbol substitution algebra ===== | ||
+ | You know your identity : | ||
+ | population[uss,th] = households[uss,usdt,th] * peoplePerHousehold[uss,usdt,th] | ||
+ | substituting from your final math Equation B for personPerHousehold: | ||
+ | population[uss,th] = households[uss,usdt,th] * population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] * relPopPersPerHH[usdt] | ||
+ | reordering: | ||
+ | population[uss,th] = households[uss,usdt,th] * relPopPersPerHH[usdt] * population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] | ||
+ | Then notice the substitution can be done for Equation A from the final math above: | ||
+ | population[uss,th] = peoplePerHouseholdEst[uss,usdt,th] * population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] | ||
+ | And the estimates cancel so you have an identity and you are comfortable your math worked | ||
+ | population[uss,th] = population[uss,th] | ||