Project

General

Profile

Support #1172

seeming errors in fnspid and mnspid variables

Added by Katy Morris about 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Start date:
03/26/2019
% Done:

70%


Description

Hello,

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.

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:

egen fpidp=max(fnspid), by (pidp)
format fpidp %12.0g

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 clonevar clones the variable correctly but is vulnerable to the same error when egen is subsequently used. A simple gen fpidp= fnspid produces the same (mostly wrong) values as the egen procedure outlined above.

I find this very puzzling - is it a Stata error? Grateful for all and any advice on how to proceed.

Katy

Also available in: Atom PDF