Hi Charity
Thanks very much for your formula. Its sounds really good. I had a go
at putting it in a check file. Following through your example below
'Diatime' is my 'vtime2' and 'diadate' is my vdate2. I thought I would
start off slowly by seeing if I coudl calculate Vhours2. I created a new
field called Vhours2 in my rec file and then I put the following code
into the check file.
DIATIME
AFTER ENTRY
LET VHOURS2=INT(DIATIME)+(FRAC(DIATIME)/0.6)+(DIADATE*24)
END
END
Epi accepted the code but nothing appears in the vhours2 field when I
enter information in the diadate and diatime fields. Can you see what I
am doing wrong?
thanks
Christine Roseveare
Analyst
Regional Public Health
570 9194
027 495 9671
>>> <epidata-list(a)lists.umanitoba.ca> 26/02/2007 7:24 p.m. >>>
Hello Chrsitine,
I prefer to enter times as a decimal field, i.e. ##.##. I can then put
checks in place to make sure the minutes are in correct time format
e.g. IF
Frac(vtime) > 0.59 THEN ....
Based on this decimal 24 hour time format, I have a formula which you
can
use to calculate the difference in hours between two time and date
combinations.
Assume that your first time and date are vtime1 and vdate1, and your
second
time and date are vtime2 and vdate2:
First calculate the number of hours (since 31st December 1899) for both
time
and date combinations (store them as vhours1 and vhours2) using the
following formulae:
vhours2=Int(vtime2) + (Frac(vtime2)/0.6) + (vdate2*24)
vhours1=Int(vtime1) + (Frac(vtime1)/0.6) + (vdate1*24)
And then you can just calculate the time difference /incubation period
into
a different variable!
timediff=vhours2-vhours1
You could also have done something similar and perhaps simpler using
EpiData's Time2Num function which will convert a decimal time into a
number
between 0 and 1 representing a fraction of a day - I just prefer to
work
with hours.
To explain the hours calculation formula for you (only need to read
below if
you care how the formula works):
Int(vtime) takes the integer part of the time, and Frac(vtime) takes
the
fractional part of the time. These are separated so Frac(vtime) alone
can be
converted from minutes into fraction of an hour (e.g. from 0.30 to
0.50).
The date integer (representing the number of days since 31 Dec 1899) is
then
multiplied by 24 to get the number of hours since 31 Dec 1899. This
1899 date is relevant only because it is how EpiData stores the date as
an
integer - we do not have to worry about this because we only care about
the
difference between the two dates.
Hope this helps!
Charity
Charity Jenkins
Data Processing Officer
Centre for Behavioural Research in Cancer
The Cancer Council Victoria
http://www.cancervic.org.au/cbrc<https://webmail.accv.org.au/exchweb/bin/redir.asp?URL=http://www.cancervic.…>
On 2/26/07, epidata-list(a)lists.umanitoba.ca
<epidata-list(a)lists.umanitoba.ca>
wrote:
>
> Hello everyone
>
> I am after advice about the best way to record time and date
> information when collecting information about food poisoning
outbreaks,
> given epidata does not have a time/date field. We want this
information
> to estimate incubation periods, in order to get clues about the
likely
> illness.
>
> Incubation
> Incubation = time from when someone is exposed to the time they
become
> unwell.
> For example someone may eat a buffet meal at 7pm on 21 February and
> become unwell at 1am on 22 February = incubation of 6 hours.
>
> Current method
> At the moment we:
> a) enter information in two fields. OnsetDay is recorded in a date
> field, and onsettime in a numeric field (####)
> b) list the two fields (using epi info) to view the information
> c) calculate incubation manually.
>
> Is there a better/easier way to do this? Also what is the
recommended
> way for entering 24 clock time - should 7.30pm be 1930 or 19.30
>
> thanks very much
>
> Christine
>
>
>
> Christine Roseveare
> Analyst
> Regional Public Health
> 570 9194
> 027 495 9671
>
>
>
>
> --
> The information contained in this email and
> any attachments is confidential and may be
> legally privileged. If you have received this
> message in error, please notify the sender
> immediately and remove all copies of the message,
> including any attachments. Any views or
> opinions expressed in this email (unless
> otherwise stated) may not represent those of
> Hutt Valley DHB.
> Thank you.
> ** Disclaimer added by HVDHB **
>
> _______________________________________________
> EpiData-list mailing list
> EpiData-list(a)lists.umanitoba.ca
> http://lists.umanitoba.ca/mailman/listinfo/epidata-list
>
--
The information contained in this email and
any attachments is confidential and may be
legally privileged. If you have received this
message in error, please notify the sender
immediately and remove all copies of the message,
including any attachments. Any views or
opinions expressed in this email (unless
otherwise stated) may not represent those of
Hutt Valley DHB.
Thank you.
** Disclaimer added by HVDHB **
Epi-Data users:
What strategies have you used to get around the limitation of only being
able to input the data on one computer? We are thinking of splitting the
file into two - with Type A respondents in one file/on one computer and Type
B respondents in another file/on a different computer and then combining the
resulting datasets in Stata. Will this work? Are there other/better
strategies?
Thanks,
Kristine Hopkins
khopkins(a)prc.utexas.edu
Hi Charity
I have tried adapting that check code to my file, just changing the
field names as necessary, and it worked perfectly. How exciting to see
my incubation times popping up effortlessly! Thanks very much for that.
Christine
Christine Roseveare
Analyst
Regional Public Health
570 9194
027 495 9671
>>> <epidata-list(a)lists.umanitoba.ca> 27/02/2007 12:24 p.m. >>>
Hi Christine,
I think I forgot to mention that for vhours to be a field it needs to
be
fairly large as the number of hours since 1899 is a big number. Also
it
needs to have two decimal places. I used a nine digit number plus two
decimals when I tried it.
Once you know you have it working you could calculate the difference
directly into the timediff field (which also needs two decimal places
but
does not need to be nearly as large) without having to store it in
vhours1
and vhours2 first, to save having meaningless numbers lying about.
Also, I didn't use the word "LET" - not sure if this makes any
difference.
And the number will not calculate until all the fields in the formula
are
filled, i.e. if you put the code in the time field but do not yet have
anything in the date field, it will not work. I put the full
calculation in
all fields so that any time a field was updated the difference would
update
also.
I will paste what I did below and hopefully it will clear anything else
up
I've forgotten to mention! Let me know how you go.
Thanks,
Charity
Below is the text from the qes file I used to test my formulae.
vtime1 ##.##
vdate1 <dd/mm/yyyy>
vhours1 #########.##
vtime2 ##.##
vdate2 <dd/mm/yyyy>
vhours2 #########.##
timediff ####.##
And the code I used in my chk file (for the second time and date only,
to
save space):
vtime2
MUSTENTER
AFTER ENTRY
IF (vtime2 < 0) OR (vtime2 > 23.59) OR (Frac(vtime2) > 0.59) THEN
HELP "Enter a valid time"
GOTO vtime2
ENDIF
vhours2=Int(vtime2) + (Frac(vtime2)/0.6) + (vdate2*24)
vhours1=Int(vtime1) + (Frac(vtime1)/0.6) + (vdate1*24)
timediff=vhours2-vhours1
END
END
vdate2
MUSTENTER
AFTER ENTRY
vhours2=Int(vtime2) + (Frac(vtime2)/0.6) + (vdate2*24)
vhours1=Int(vtime1) + (Frac(vtime1)/0.6) + (vdate1*24)
timediff=vhours2-vhours1
END
END
vhours2
NOENTER
END
Charity Jenkins
Data Processing Officer
Centre for Behavioural Research in Cancer
The Cancer Council Victoria
http://www.cancervic.org.au/cbrc<https://webmail.accv.org.au/exchweb/bin/redir.asp?URL=http://www.cancervic.…>
On 2/27/07, epidata-list(a)lists.umanitoba.ca
<epidata-list(a)lists.umanitoba.ca
> wrote:
>
> Hi Charity
>
> Thanks very much for your formula. Its sounds really good. I had a
go
> at putting it in a check file. Following through your example below
> 'Diatime' is my 'vtime2' and 'diadate' is my vdate2. I thought I
would
> start off slowly by seeing if I coudl calculate Vhours2. I created a
new
> field called Vhours2 in my rec file and then I put the following
code
> into the check file.
>
>
> DIATIME
> AFTER ENTRY
> LET VHOURS2=INT(DIATIME)+(FRAC(DIATIME)/0.6)+(DIADATE*24)
> END
> END
>
> Epi accepted the code but nothing appears in the vhours2 field when
I
> enter information in the diadate and diatime fields. Can you see what
I
> am doing wrong?
>
>
> thanks
>
> Christine Roseveare
> Analyst
> Regional Public Health
> 570 9194
> 027 495 9671
>
>
--
The information contained in this email and
any attachments is confidential and may be
legally privileged. If you have received this
message in error, please notify the sender
immediately and remove all copies of the message,
including any attachments. Any views or
opinions expressed in this email (unless
otherwise stated) may not represent those of
Hutt Valley DHB.
Thank you.
** Disclaimer added by HVDHB **
In writing documentation, help file, how to's, faq solutions etc. the
problem is not so much to give solutions, but how to write solutions in
a way where users actually find them.
For the age calculation if you look in EpiData Entry file under "time
functions" you will see:
...................
LET INT1=(ROUND(INT((TODAY-D1)/365.25))
Calculates the age of a person whose date of birth was entered in D1.
Round is needed to convert the result of the calculation from a real
number to a integer number.
...................
and if you look in the help file for entry under "time functions" or
"time about" or
"Age on specific date" one example clearly shows how to do the
calculations questioned on the list recently.
The time example is also included with the installation of the Entry
programme.
I am not saying this to "point fingers" at the recent questioning on
this list, but to underline that despite the amount of documentation,
field notes, help files etc. it is my firm conviction that there is a
definite need for a lively help line.
For users following the Stata list or having used the very large volume
of documentation and help facilities for Stata (www.stata.com) you will
notice that also on that list questions shows up on issues actually
explained but users not finding them.
In other words: We can and should include obvious "often asked issues"
in documentation, but even if we do, there will be someone not finding
this information. Which is exactly why a large user base where someone
find and take the time to answer these questions on the EpiData list is
very important.
Regards
Jens Lauritsen
EpiData Association
Hello everyone
I am after advice about the best way to record time and date
information when collecting information about food poisoning outbreaks,
given epidata does not have a time/date field. We want this information
to estimate incubation periods, in order to get clues about the likely
illness.
Incubation
Incubation = time from when someone is exposed to the time they become
unwell.
For example someone may eat a buffet meal at 7pm on 21 February and
become unwell at 1am on 22 February = incubation of 6 hours.
Current method
At the moment we:
a) enter information in two fields. OnsetDay is recorded in a date
field, and onsettime in a numeric field (####)
b) list the two fields (using epi info) to view the information
c) calculate incubation manually.
Is there a better/easier way to do this? Also what is the recommended
way for entering 24 clock time - should 7.30pm be 1930 or 19.30
thanks very much
Christine
Christine Roseveare
Analyst
Regional Public Health
570 9194
027 495 9671
--
The information contained in this email and
any attachments is confidential and may be
legally privileged. If you have received this
message in error, please notify the sender
immediately and remove all copies of the message,
including any attachments. Any views or
opinions expressed in this email (unless
otherwise stated) may not represent those of
Hutt Valley DHB.
Thank you.
** Disclaimer added by HVDHB **
Thank you Jamie for today mornings message. I was confused by the complex syntax of American date selection
This solution was also obtained over the week end while working on a Fedora Linux machine on which Epidata entry and Analysis latest versions were installed..
Simple formulas, which produced wonders, are given below;
define interval ###
let interval=wdate - dbirth
*calculate the interval in days using American dates.
define interval ###
let interval=(wdate dbirth)30.44
results in a error Data type mismatch
define interval ###.#
let interval=(wdate dbirth)/30.44
calculates the interval months using American dates.
Epi Analysis accepts float type variables as suggested by Gillis Delmas. However round or integer prefix do not help. The output is produced in decimals and not rounded to the nearest figure.
I wanted to obtain the current age hence did not include this formula in Epidata Entry as suggested by Pedro Emmanuel Brasil
One request to Jens;
Such examples should be included in the help file in the form of simple FAQs, which can save hours or even days of Epi Analysis Users (beginner and even experienced!!).
Thank you friends for your timely help
Much appreciated
Dr. Shavinder Singh
Dear Friends,
Thanks for your time and effort. I tried in so many many ways. Nothing is working. I am attching a sample file with following PGM.
The error message obtained are shown in the next line beginning with "*"
Kindly help.
With regards,
Dr. Shavinder Singh
*Try.pgm
cls
close
set echo=off
set replace logfile=on
read "d:\work\amdate.rec"
define wdateu <DD/MM/YYYY>
LET wdateu=wdate
define dbirthU <DD/MM/YYYY>
LET dbirthU=dbirth
logopen "TRY.PGM OUTPUT FILE" /CLOSE
define interval ###
let interval=date("wdateu","dmy")- date("dbirthu","dmy")
list Interval
*Error message - (NO RESPONSE)
define interval2 ###
let interval2=Integer(date("wdate" - "dbirth"))
list Interval2
*Error message Access violation at address 006C91D6 in module 'EPIDATASTAT.EXE'. Read of address FFFFFFFF
define interval3 ###
let interval3=Integer(date("wdate") - date("dbirth"))
list Interval3
*Error message - (NO RESPONSE)
define interval4 ###
let interval4=Integer(round(date("wdate","mdy")- date("dbirth","mdy")))
list Interval4
*Error message -(NO RESPONSE)
close
Hi Jamie, thanks for helping me out with the <IDNUM> problem! You also
answered my other question about how to show the <IDNUM> in the
statusbar. Bye, Ben.
Hi all,
Thanks Juergen for your valuable tip to use
respnumber
TYPE SATUSBAR
end
to show the value of field 'respnumber' in the statusbar during data
entry! I'm quite unexperienced in using epidata and didn't know of this
nice feature.
Still I have a question. Is it also possible to show the value of the
automatic IDNUM field in the statusbar? The reason for this question is
that I do not want to enter the respondent number myself, but would like
to use the automatically generated IDNUM instead.
More or less related is the next question. If one uses the following two
lines (look quite meaningless, I agree)
<IDNUM>
<IDNUM>
in the QES file, then why does, during data entry, the first <IDNUM>
always stay 1 - even after entering the second, third etc. case - while
the second <IDNUM> is adjusted to the correct case number, i.e., the one
who's data are currently being entered?
Bye and thanks for any help, Ben.
Hi all,
With many fields to enter, the QES file of epidata can easily become
very large and cover 2 (or even more) subsequent screens. While entering
the data, after having filled in the last field of screen 1, there will
be a continuous scrolling down after each next field is entered. To
prevent this continuous scrolling of the screen, one can use the
TOPOFSCREEN command in the CHK file, which places the field in question
at the top of the second entry screen. This results in a more steady
(over)view during data entry, which I think is preferable.
Now to my question. At the top of the first screen I show the value of
the automatic <IDNUM> field, which corresponds with the respondent
number written on the questionnaires. Is there a way to have this
<IDNUM> shown at the top of EACH new data entry screen? I've tried this
by simply putting the text
respondent: <IDNUM>
at the top of each new screen. However, this didn't work well, since
after the entry and saving of record 1, the next empty datarecord for
case 2 is shown, but instead of showing
respondent 2
it shows
respondent 1
while at the second screen it shows
respondent 2
Probably I'm doing something strange, with showing the IDNUM field more
then one time in the same REC file.
Does anyone know a method to manage this problem?
Thanks, Ben.