You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JuergenWiemers drew my attention to the fact that our endogenous fg_id creation is sensitive to the order of adults in the data.
Consider the example input below. This is a 3-person household (parent + child and other adult in an Einstandsgemeinschaft with the parent). Note that the order of people in the household is a bit peculiar: First the childless adult, then the child, then the parent. Here, we would expect:
This is due to the loop in our fg_id algorithm. There, the algorithm loops over p_ids in the data. For a given p_id, the loop starts with a candidate fg_id, assigns this fg_id to the current p_id, its Einstandspartner, and its children. The candidate fg_id then increases by 1 and the loop continues with the next p_id that does not have a matched fg_id yet.
The problem in the example below is that, the loop does not recognise the child as an fg_id member. In the first iteration, it assigns fg_id 0 to the first and last adult (Einstandspartner), but at this point, it does not know that the last adult has children in the household.
From what I see, this is also not solved by sorting the (internal) DataFrame properly in more complicated family structures (e.g. 2 adults and 2 children, each child is from a different partner).
Bug description
@JuergenWiemers drew my attention to the fact that our endogenous
fg_id
creation is sensitive to the order of adults in the data.Consider the example input below. This is a 3-person household (parent + child and other adult in an Einstandsgemeinschaft with the parent). Note that the order of people in the household is a bit peculiar: First the childless adult, then the child, then the parent. Here, we would expect:
The result, however is:
This is due to the loop in our
fg_id
algorithm. There, the algorithm loops overp_id
s in the data. For a givenp_id
, the loop starts with a candidatefg_id
, assigns thisfg_id
to the currentp_id
, its Einstandspartner, and its children. The candidatefg_id
then increases by 1 and the loop continues with the nextp_id
that does not have a matchedfg_id
yet.The problem in the example below is that, the loop does not recognise the child as an
fg_id
member. In the first iteration, it assignsfg_id
0 to the first and last adult (Einstandspartner), but at this point, it does not know that the last adult has children in the household.From what I see, this is also not solved by sorting the (internal) DataFrame properly in more complicated family structures (e.g. 2 adults and 2 children, each child is from a different partner).
Example Input
The text was updated successfully, but these errors were encountered: