# whatIf? Wiki

### Site Tools

howtos:toolcoding:using_a_relative_propensity

# Using relative propensities to create data based on some simple assumptions

When you have an equation with more unknowns that constraints and you want to add some assumptions to solve it you may add a relative propensity calculation. Best served by an example. It can also be thought of as an estimate where only the relative values matter and the level will be determined by scaling it to the know data.

## Example

Given:

``` households[uss,usdt,th]
population[uss,th]```

Want to get:

` peoplePerHousehold[uss,usdt,th]`

constraints:

` population[uss,th] = sum (households[uss,usdt,th] * peoplePerHousehold[uss,usdt,th]; dim=usdt)`

makeup a relative propensity:

` relPopPersPerHH[usdt] = where each value is related to one of the entries `

Finally the math to calculate peoplePerHousehold[uss,usdt,th] is:

```  !Equation A:
local populationEst[uss,th] = sum (households[uss,usdt,th] * relPopPersPerHH[usdt]; dim=usdt)
!Equation B:
peoplePerHousehold[uss,usdt,th] = (population[uss,th] / populationEst[uss,th]) * relPopPersPerHH[usdt]``` 