Understanding Society User Support: Issueshttps://iserredex.essex.ac.uk/support/https://iserredex.essex.ac.uk/support/support/favicon.ico?15995719382019-03-26T17:19:43ZUnderstanding Society User Support
Redmine Understanding Society User Support - Support #1172 (Resolved): seeming errors in fnspid and mnspi...https://iserredex.essex.ac.uk/support/issues/11722019-03-26T17:19:43ZKaty Morriskaty.morris@eui.eu
<p>Hello,</p>
<p>I am trying to match parents and children in UKHLS (using via pidp, fnspid and mnspid variables) and obtain a peculiar error when doing so in Stata.</p>
<p>Having merged all waves, I'm using the egen command in order to pick up any parents who are not identified in the wave the respondent enters UKHLS, as follows:</p>
<blockquote>
<p>egen fpidp=max(fnspid), by (pidp)<br />format fpidp %12.0g</p>
</blockquote>
<p>Unfortunately this generates incorrect data, for example pipd 29925, whose father is officially fnspid 614482685 somehow becomes 614482688 using the above syntax. This is one of many, many errors that I can see. Having tried to find ways around this, it turns out that <em>clonevar</em> clones the variable correctly but is vulnerable to the same error when <em>egen</em> is subsequently used. A simple gen fpidp= fnspid produces the same (mostly wrong) values as the <em>egen</em> procedure outlined above.</p>
<p>I find this very puzzling - is it a Stata error? Grateful for all and any advice on how to proceed.</p>
<p>Katy</p>