13.07.2015 Views

LIAM 2 User Guide

LIAM 2 User Guide

LIAM 2 User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>LIAM</strong> 2 <strong>User</strong> <strong>Guide</strong>, Release 0.7.05.5.10 Lifecycle functionsnewnew creates new individuals. It can create individuals of the same entity (eg. a women gives birth) or another entity(eg. a person‘s marriage creates a new houshold). The function returns the id of the newly created individuals.generic formatnew(’entity_name’[, filter=expr][, number=value]*set initial values of a selection of variables*)The first argument specifies the entity in which the individuals will be created (eg person, household, ...).Then, one should use one of either the filter or the number argument.• filter specifies which individuals of the current entity will serve as the origin for the new individuals (forpersons, that would translate to who is giving birth, but the function can of course be used for any kind ofentity).• number specifies how many individuals need to be created. In this version, those new individuals do nothave an “origin”, so they can copy value from it.Any subsequent argument specifies values for fields of the new individuals. Any field which is not specified therewill receive the missing value corresponding to the type of the field (‘nan’ for floats, -1 for integers and False forbooleans). Those extra arguments can be given constants, but also any expression (possibly using links, randomfunctions, ...). Those expressions are evaluated in the context of the origin individuals. For example, you couldwrite “mother_age = age”, which would set the field “mother_age” on the new children to the age of their mother.example 1birth:- to_give_birth: logit_regr(0.0,filter=not gender and(age >= 15) and (age

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!