creating an identifiant from various variables
Dear all,
I would have a question about the creation of an identifier for data entry. I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4 variables. For instance my identifier is ID=region number+village number+household number+member in the household number Do you have any clue about how to do this? Thank you for your help. Jean-Francois
Here is a simple example:
DATA FILE: C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
File label: Test Indexing
File size: 693 bytes
Last revision: 15. May 2009 1:28 PM
Number of fields: 5
Number of records: 3
Checks applied: Yes (Last revision 15. May 2009 1:27 PM)
Fields in data file:
No. Name Variable label Field type Width Checks
--------------------------------------------------------------------------------
1 v1 Text 3 Must enter
2 v2 Text 3 Must enter
3 v3 Text 4 Must enter
4 v4 Number 2 Must enter
More: See check file
5 i6 Text 12 NoEnter
--------------------------------------------------------------------------------
and check file:
v1
MUSTENTER
END
v2
MUSTENTER
END
v3
MUSTENTER
END
v4
MUSTENTER
AFTER ENTRY
I6=V1 + v2 + v3 + String(v4)
END
END
i6
NOENTER
END
Data looks like:
List of observations in C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
List created 15. May. 2009 1:28 PM
Records in file: 3
Records in list: All
Deleted records are skipped.
Observation 1 (record # 1)
v1 001 v2 304 v3 4837
v4 12 i6 001304483712
Observation 2 (record # 2)
v1 111 v2 222 v3 3333
v4 44 i6 111222333344
Observation 3 (record # 3)
v1 123 v2 456 v3 7890
v4 12 i6 123456789012
This example uses first three variables as strings, and the fourth as a number converted to a string.
Pete Geddes
epidata-list@lists.umanitoba.ca wrote:
Dear all,
I would have a question about the creation of an identifier for data entry.
I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4 variables.
For instance my identifier is
ID=region number+village number+household number+member in the household number
Do you have any clue about how to do this?
Thank you for your help.
Jean-Francois
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
Hello,
In case your variables are of number type (rather than text), and using Pete's example for the length of the variables, you can alternatively do:
v4
MUSTENTER
AFTER ENTRY
I6=(v1*1000000000) + (v2*1000000) + (v3*100) + v4
END
END
Good luck!
Yves --------------------------------------------------------------------- Yves MARTIN-PREVEL, Epidemiologist, MD, MSc, PhD 'Nutripass' IRD (WHO Collaborating Center for Nutrition) UMR204 IRD/Montpellier1/Montpellier2/SupAgro Institut de Recherche pour le Développement (IRD) BP 64501 - 911, avenue d'Agropolis 34394 MONTPELLIER CEDEX 5 (France) yves.martin-prevel@ird.fr Tel: +33(0)4.67.41.61.70 - Fax: +33(0)4.67.41.61.57 https://www.mpl.ird.fr/ur106/index.htm http://www.cilss.bf/nusapps/
-----Message d'origine----- De : epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] De la part de epidata-list@lists.umanitoba.ca Envoyé : vendredi 15 mai 2009 19:39 À : epidata-list@lists.umanitoba.ca Objet : Re: [EpiData-list] creating an identifiant from various variables
Here is a simple example:
DATA FILE: C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
File label: Test Indexing
File size: 693 bytes
Last revision: 15. May 2009 1:28 PM
Number of fields: 5
Number of records: 3
Checks applied: Yes (Last revision 15. May 2009 1:27 PM)
Fields in data file:
No. Name Variable label Field type Width Checks
---------------------------------------------------------------------------- ----
1 v1 Text 3 Must enter
2 v2 Text 3 Must enter
3 v3 Text 4 Must enter
4 v4 Number 2 Must enter
More: See check file
5 i6 Text 12 NoEnter
---------------------------------------------------------------------------- ----
and check file:
v1
MUSTENTER
END
v2
MUSTENTER
END
v3
MUSTENTER
END
v4
MUSTENTER
AFTER ENTRY
I6=V1 + v2 + v3 + String(v4)
END
END
i6
NOENTER
END
Data looks like:
List of observations in C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
List created 15. May. 2009 1:28 PM
Records in file: 3
Records in list: All
Deleted records are skipped.
Observation 1 (record # 1)
v1 001 v2 304 v3 4837
v4 12 i6 001304483712
Observation 2 (record # 2)
v1 111 v2 222 v3 3333
v4 44 i6 111222333344
Observation 3 (record # 3)
v1 123 v2 456 v3 7890
v4 12 i6 123456789012
This example uses first three variables as strings, and the fourth as a number converted to a string.
Pete Geddes
epidata-list@lists.umanitoba.ca wrote:
Dear all,
I would have a question about the creation of an identifier for data
entry.
I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4
variables.
For instance my identifier is
ID=region number+village number+household number+member in the household
number
Do you have any clue about how to do this?
Thank you for your help.
Jean-Francois
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
_______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
I would copy the 'after entry' to v1-v3 also - otherwise later revisions of v1-v3 will not be reflected in i6 if one do not 'pass' v4.
Seniorstatistician Claus Holst Institute of Preventive Medicine Center for Health and Society Øster Søgade 18, 1 DK-1357 København K
epidata-list@lists.umanitoba.ca Sendt af: epidata-list-bounces@lists.umanitoba.ca 15-05-2009 19:38
Til epidata-list@lists.umanitoba.ca cc
Emne Re: [EpiData-list] creating an identifiant from various variables
Here is a simple example:
DATA FILE: C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
File label: Test Indexing
File size: 693 bytes
Last revision: 15. May 2009 1:28 PM
Number of fields: 5
Number of records: 3
Checks applied: Yes (Last revision 15. May 2009 1:27 PM)
Fields in data file:
No. Name Variable label Field type Width Checks
--------------------------------------------------------------------------------
1 v1 Text 3 Must enter
2 v2 Text 3 Must enter
3 v3 Text 4 Must enter
4 v4 Number 2 Must enter
More: See check file
5 i6 Text 12 NoEnter
--------------------------------------------------------------------------------
and check file:
v1
MUSTENTER
END
v2
MUSTENTER
END
v3
MUSTENTER
END
v4
MUSTENTER
AFTER ENTRY
I6=V1 + v2 + v3 + String(v4)
END
END
i6
NOENTER
END
Data looks like:
List of observations in C:\Documents and Settings\Owner.YOUR-E92F6775CF\My Documents\EpiData\testindex.rec
List created 15. May. 2009 1:28 PM
Records in file: 3
Records in list: All
Deleted records are skipped.
Observation 1 (record # 1)
v1 001 v2 304 v3 4837
v4 12 i6 001304483712
Observation 2 (record # 2)
v1 111 v2 222 v3 3333
v4 44 i6 111222333344
Observation 3 (record # 3)
v1 123 v2 456 v3 7890
v4 12 i6 123456789012
This example uses first three variables as strings, and the fourth as a number converted to a string.
Pete Geddes
epidata-list@lists.umanitoba.ca wrote:
Dear all,
I would have a question about the creation of an identifier for data
entry.
I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4
variables.
For instance my identifier is
ID=region number+village number+household number+member in the household
number
Do you have any clue about how to do this?
Thank you for your help.
Jean-Francois
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
_______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
In my example, you'll need to add additional checks to make certain the first three variables have 3, 3, and 4 characters -- to get 10 plus one or two member in household number.
epidata-list@lists.umanitoba.ca wrote:
Dear all,
I would have a question about the creation of an identifier for data entry. I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4 variables. For instance my identifier is ID=region number+village number+household number+member in the household number Do you have any clue about how to do this? Thank you for your help. Jean-Francois _______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
One aspect of this about unique identifiers is when users want to do double entry.
The only double entry option in this situation is to enter the data twice and then compare afterwards, since the "immediate comparison" double entry mode is not available for combined field unique entries unless the records are entered in EXACTLY the same sequence as the first time. The problem for the user is, that the system is NOT giving correct warnings in the immediate double entry if the unique index is created in contrast to entered directly.
I would like the identifier to be automatically created in the .rec file after entering 4 variables and as an aggregation of these 4 variables. For instance my identifier is ID=region number+village number+household number+member in the household number
regards Jens Lauritsen EpiData Association
participants (1)
-
epidata-list@lists.umanitoba.ca