Hi, guys
I have a database with weight and height information for children at different follow-up dates over five years. Especially with regard to height (variable "alt_en"), I would like to identify when this measure decreased over the follow-up records (which means inconsistency in the data, since a child does not decrease in height over time).
In the example below, the same individual (id) has 34 height (alt_en) records between the years 2016 to 2019. Height is expected to be always increasing (or at least stable, but never decreasing). You can observe these inconsistencies in other "id".
How could you systematically identify these inconsistencies in the height measurement over the years in the complete database?
I thank the help of all you.
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
I have a database with weight and height information for children at different follow-up dates over five years. Especially with regard to height (variable "alt_en"), I would like to identify when this measure decreased over the follow-up records (which means inconsistency in the data, since a child does not decrease in height over time).
In the example below, the same individual (id) has 34 height (alt_en) records between the years 2016 to 2019. Height is expected to be always increasing (or at least stable, but never decreasing). You can observe these inconsistencies in other "id".
How could you systematically identify these inconsistencies in the height measurement over the years in the complete database?
I thank the help of all you.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long id byte sexo_en float(ano_acomp_en datanasc_en dataacomp_en idade_meses_en alt_en seq_juncao_en max_juncao_en) 59268007 1 2016 19308 20471 38.20945 102 1 34 59268007 1 2016 19308 20487 38.73511 103 2 34 59268007 1 2016 19308 20528 40.08214 107 3 34 59268007 1 2016 19308 20569 41.42916 110 4 34 59268007 1 2016 19308 20587 42.02053 104 5 34 59268007 1 2016 19308 20612 42.84189 104 6 34 59268007 1 2016 19308 20662 44.4846 106 7 34 59268007 1 2016 19308 20682 45.14169 106 8 34 59268007 1 2016 19308 20706 45.93018 108 9 34 59268007 1 2017 19308 20828 49.9384 111 10 34 59268007 1 2017 19308 20852 50.7269 110 11 34 59268007 1 2017 19308 20885 51.81109 113 12 34 59268007 1 2017 19308 20936 53.48665 110 13 34 59268007 1 2017 19308 20957 54.17659 112 14 34 59268007 1 2017 19308 20984 55.06365 112 15 34 59268007 1 2017 19308 21018 56.1807 112 16 34 59268007 1 2017 19308 21039 56.87064 116 17 34 59268007 1 2017 19308 21104 59.00616 116 18 34 59268007 1 2018 19308 21223 62.91581 119 19 34 59268007 1 2018 19308 21257 64.03285 119 20 34 59268007 1 2018 19308 21285 64.952774 119 21 34 59268007 1 2018 19308 21299 65.41273 118 22 34 59268007 1 2018 19308 21320 66.10267 119 23 34 59268007 1 2018 19308 21349 67.05544 119 24 34 59268007 1 2018 19308 21382 68.13963 119 25 34 59268007 1 2018 19308 21474 71.16222 120 26 34 59268007 1 2019 19308 21594 75.10472 121 27 34 59268007 1 2019 19308 21628 76.22176 121 28 34 59268007 1 2019 19308 21692 78.32443 127 29 34 59268007 1 2019 19308 21725 79.40862 127 30 34 59268007 1 2019 19308 21760 80.55852 127 31 34 59268007 1 2019 19308 21781 81.24846 127 32 34 59268007 1 2019 19308 21819 82.49692 127 33 34 59268007 1 2019 19308 21850 83.5154 129 34 34 end format %td datanasc_en format %td dataacomp_en label values sexo_en sexo label def sexo 1 "masculino", modify
Comment