To assist Kate with the appending problem we must know more:
a. Are you using EpiData Entry or EpiData Analysis
b. Which version and build
See about box or in analysis: Version
c. Show a listing of the variable types of the four variables in each of
the two files.
To do this:
In EpiData Entry: Document - file structure
In Analysis: read the file and then issue the command "var"
Cut and paste into for the relevant four variables into a new mail
to the epidata-list
Regards
Jens Lauritsen
EpiData Association
Kate:
Could it be that one of the variables at some places has an illegal
value? I observed it with dates: while EpiData will accept a year "203"
for instance, it seems that if you append in EpiData Analysis, you could
get this type of error message.
You could go to the variable(s) in question in EpiData Analysis, sort on
the variable, browse and look at the beginning an the end whether there
is anything that could be fishy. This of course after you used the
command "variables" in both datasets to ensure that the structure is
indeed identical.
Hans
I have a question regarding appending files properly. I'm attemping to
append 2 datasets, and the program states that 4 variables among the 2
datasets are incompatible. The variables appear to be consistent across
both datasets, so I'm at a bit of a loss. Any help would be appreciated.
Thanks, Kate
--
Hans L Rieder, MD, MPH
Jetzikofenstr. 12
3038 Kirchlindach
Switzerland
Tel: +41 31 829 4577
Mob: +41 79 429 9945
Web: http://www.tbrieder.org
Question to info at Epidata:
I have two successive periods: 1 and 2
I wish a graph where the first 6 observations in each period are included
and on the graph the x axis should say 1 2 3 4 5 6 in both of them
Using the Ichart.rec example included in installation of EpiData Analysis:
file: ichart.rec which has 27 observations
variables:
lege : counts for a given doctor (lege is doctor in Norwegian)
dag : consecutive number of observations (values are 1 - 27)
Assume that period 1 in the study was observation 1-14 and observation
15-27 was period 2.
Read the data en calculate as indicated after the "//" is comments
................................................................................................
read ichart
define d ##
d = _n // _n is the same as recnumber the observation
number of the data
if d > 15 then d = d -15 // now d is the correct number
withing each period
select if d < 7 // only include first 6
observations from each period
ichart dag lege // this would show x
axis with values of variable dag
ichart dag lege /break=7 /xlabel=d // this would make a break for the
two periods and use d as label
................................................................................................
Similarly for date variables:
................................................................................................
ichart tid lege /break="01/01/2003" /xlabel=d // if the value of
"tid" was "01/01/2003" for observation 7
................................................................................................
The format of the break value should for dates be the same as the x axis
variable.
The graph above will show a gap btw. the two periods since the x-axis
variable has values from 1 to 27
If one has consecutive numbers e.g. 1-12 and you wish to have larger
separation of the two periods:
................................................................................................
define d1 ##
d1 = _n
if d1 > 6 then d1 = d1+2 // experiment a bit if you wish 1,
2 or more added
ichart d1 lege /break=7 /xlabel=d // this would move the two parts of
the graph apart
................................................................................................
Regards
Jens Lauritsen
EpiData Association
ps. Unfortunately the /xlabel option is not in the current commands and
functions reference.
Will be added to next release.
1- CHK file size: I use to edit most of my chk files with an editor (metapad is the most convenient I could find, and it's freeware); I use to work with quite large chk files, and I never noticed anything wrong with opening it with an expernal text editor.
2- Variables deleted from the qes file:
No, variables will not be removed from the check file.
Here is what to do:
1st time you try to enter dada after the QES has been modified:
Display: 'Revise data from revised revised QES file?' Click Yes
Display: The revised QES file will cause loss of data in these fields... (list of fields that have been removed) click "Accept"
Then, warning displays: "Could not apply checks (...)" click Yes. The CHK file opens on the left side of the screen, while a log file explaining where the detected errors are.
Move (left) to the concerned area (ex: variable DATA1 has been removed. Go to the line containing checks for DATA1, and delete all lines from this block (from DATA1 to the last END of the block).
You should also use the 'Find' feature to look for DATA1 within the whole chk file (in case other variables refer to it in their checks) and remove all DATA1 occurrences.
Gilles Delmas
InVS Paris
-----Message d'origine-----
De : epidata-list(a)lists.umanitoba.ca [mailto:epidata-list@lists.umanitoba.ca]
Envoyé : vendredi 18 novembre 2005 22:26
À : epidata-list(a)lists.umanitoba.ca
Objet : RE: [EpiData-list] new to epidata: 2 questions
Many thanks to all of you who answered my questions.
Here's another one. I need to removed a number of variables and revise the .chk file to correspond to the .rec file. The easiest thing to do would be to make the changes in an editor (notepad, e.g.). The Epidata documentation says that a .chk file may not be more than 64K (I believe) if it is being created in an editor. The .chk file is now about 108K. Does this mean I can't make the changes in an editor?
Richard Herrell
NIMH
2 I've discovered I need to delete a number of variables from the data file. This seems straightforward since I can simply delete them from the .qes file and they will be deleted from the .rec file. What happens to the .chk file when I open the new .rec file with deleted variables? Will Epidata revise the .chk file by deleting the checks for variables that no longer exist?
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
-----Message d'origine-----
De : epidata-list(a)lists.umanitoba.ca [mailto:epidata-list@lists.umanitoba.ca]
Envoyé : mardi 15 novembre 2005 21:14
À : epidata-list(a)lists.umanitoba.ca
Objet : [EpiData-list] new to epidata: 2 questions
I'm fairly new to Epidata and have a couple of questions:
1 In the file manager, the check file I've created has "recovered file fragments" as the file type. Is that correct?
>>>> Recovered file fragments: Yes, this is normal, as Windows uses also the CHK suffix to name specific system files. Don't worry about it, as Epidata knows how to open these files. In case you want to open these files with an external text editor (to enter advanced check commands), right-click on the corresponding CHK file, select "Open with..." and browse to your favorite text editor (e.g. Wordpad, metapad...)
2 I've discovered I need to delete a number of variables from the data file. This seems straightforward since I can simply delete them from the .qes file and they will be deleted from the .rec file. What happens to the .chk file when I open the new .rec file with deleted variables? Will Epidata revise the .chk file by deleting the checks for variables that no longer exist?
>>>> No, variables will not be removed from the check file.
Here is what to do:
1st time you try to enter dada after the QES has been modified:
Revise data from revised revised QES file? (Yes)
The revised QES file will cause loss of data in these fields... (list of fields removed) click "Accept"
Then, warning displays: "Could not apply checks (...)" click Yes
The CHK file opens on the left side of the screen, while a log file explaining where the detected errors are.
Move (left) to the concerned area (ex: variable DATA1 has been removed. Go to the line containing checks for DATA1, and delete all lines from this block (from DATA1 to the last END of the block).
You should also use the 'Find' feature to look for DATA1 within the whole chk file (in case other variables refer to it in their checks) and remove all DATA1 occurrences.
Many thanks for any help.
Richard Herrell
NIMH
______________________________________________
Gilles DELMAS
Institut de Veille Sanitaire
Dept. Maladies Infectieuses,
Unité infections entériques, alimentaires et zoonoses
12 rue du Val d'Osne 94415 Saint-Maurice cedex - France
+ 33 1 41 79 67 27
g.delmas(a)invs.sante.fr
______________________________________________
To work efficiently with string variables a few techniques are needed:
To work with string variables some functions are needed:
Length of a string: length("Abcde") = 5
Convert to upper: upper("Abcde") = "ABCDE"
Remove blanks: trim("Abcde ") = "Abcde"
Look for a given text in a string: pos("Abcde","cd") = 3
A. How do I select those with empty contents of a variable S (string).
In person language this would mean:
1. Remove all blanks/spaces from my variable
2. Is the trimmed length of the variable greater than zero ?
Yes: The string is NOT empty
No: The string is empty
So in analysis language this is:
1: trim(S)
2: length(trim(S))
and to use this as select :
"YES" from above: Select if (length(trim(S)) > 0)
"NO" from above: Select if (length(trim(S)) = 0)
alternative:
"YES" from above: Select if ( trim(S) <> "")
"NO" from above: Select if ( trim(S) = "")
The user will notice the many parenthesis ( ). The reason I add an outer
parenthesis is
to be sure that the whole sentence is handled correctly.
B. How to select observations with a certain string value:
In person language this would mean:
1. Make sure not to confuse lower and upper case entry of the text
2. Identify the string I wish to search on
3. Does the variable contain the string ?
And in analysis language this is:
1: upper(S)
2: e.g. "DOG"
3: pos(upper(S),"DOG")
and to use this as select :
"YES" from above: Select if (pos(upper(S),"DOG") > 0 )
"NO" from above: Select if (pos(upper(S),"DOG") = 0 )
C. Complicated string values:
Assume you wish to select all text strings with content DOG, but not if
these also contained the word "WHITE"
- that is find all dogs, but exclude the white ones.
Select if ( (pos(upper(S),"DOG") > 0 ) and (pos(upper(S),"WHITE") = 0 ))
If you wished to find all DOGs or CATs:
Select if ( (pos(upper(S),"DOG") > 0 ) or (pos(upper(S),"CAT") = 0 ) )
It is often difficult to get the correct number of parenthesis. But
start with the innermost one and build
from there. Handling all types of strings with different national
characters is difficult, therefore
it is good practice to use upper() and many parenthesis to assist the
programme in working correctly.
Jens Lauritsen
EpiData Association
hi. in my experience:
1. "recovered file fragments" is a MS naming of .chk files. and probaly other rhings it doesn't know about.
2. if you remove a variable from the .QES and try to enter data the error message will appear
saying that the variable name you have in the .CHK is an UNKNOWN COMMAND.
3. so, the answer to your question is: no, Epidata will not remove from the .chk variables
which have been removed from the .QES. you'll have to do this yourself...at least it's what
I have to do.
-----Original Message-----
From: epidata-list(a)lists.umanitoba.ca [mailto:epidata-list@lists.umanitoba.ca]
Sent: Tue 11/15/2005 3:14 PM
To: epidata-list(a)lists.umanitoba.ca
Cc:
Subject: [EpiData-list] new to epidata: 2 questions
I'm fairly new to Epidata and have a couple of questions:
1 In the file manager, the check file I've created has "recovered file fragments" as the file type. Is that correct?
2 I've discovered I need to delete a number of variables from the data file. This seems straightforward since I can simply delete them from the .qes file and they will be deleted from the .rec file. What happens to the .chk file when I open the new .rec file with deleted variables? Will Epidata revise the .chk file by deleting the checks for variables that no longer exist?
Many thanks for any help.
Richard Herrell
NIMH
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
| 1 In the file manager, the check file I've created has "recovered file
fragments" as the file type. Is that correct?
A: .chk is also the file type used by Windows when it checks your disk
and finds orpha bits of files. You'll rarely, if ever, use or care about
these files. I suggest you go to EpiData's options (File, Options),
select the 'File Associations' tab, check all the boxes and click on
'Associate File Types'. Then all of your EpiData files will be properly
described.
>
>2 I've discovered I need to delete a number of variables from the data file. This seems straightforward since I can simply delete them from the .qes file and they will be deleted from the .rec file. What happens to the .chk file when I open the new .rec file with deleted variables? Will Epidata revise the .chk file by deleting the checks for variables that no longer exist?
>
>
You have two choices here. You may edit the chk file using File, Open.
In the file dialogue, select the 'Files of type' to be 'EpiData check
file (.chk)'. This brings up the full .chk file in EpiData's text
editor. Just block the lines that begin with the name of the field you
deleted and ending with its matching 'END' - this will be just before
the next field name.
Or you can click on 'Check' in the workflow buttons. EpiData will ask
you if you want to delete the lines for the fields you removed (respond
'No') or comment them out (respond 'Yes'). However, EpiData won't
actually do these things unless you change something, or pretend to
change something, so that the 'Save' button becomes active. So you can
just click on 'Edit' for any field, click on 'Accept changes' and then
click on 'Save'.
It is useful to get to know what .chk files look like inside, so I
suggest the first option unless you are uneasy about editing files.
Jamie Hockin
Public Health Agency of Canada