Hans wishes to get from
SET12.REC with variables: ID AGE SEX VAR1 VAR2
- where each person (ID) have four records which we each call one visit
to
NEWSET.REC with variables: ID AGE SEX VAR11 VAR21 VAR12 VAR22 VAR13
VAR23 VAR14 VAR24
where each person (ID) have one record
This conversion can be named "From long to wide format" and is a
conversion we often wish to work on:
In the example it is quite easy, since it seems that there are exactly
four visits per person.
One way of doing this is: (principle must be tested on actual data)
read set12.rec
freq id // here I would look to make sure that all id's actually
had four records
* We assume that the order of visits in set12 is chronological, but wish
to have an identifier:
gen i visit = 1 // integer variable with value 1 for all
if id = id[_n-1] then visit = visit[_n-1] + 1 // now the value of
visit is correct 1 2 3 4
* the [_n] indicates recnumber and by subtracting one "_n-1" we get the
previous record
browse // here I would look to control that the calculation was
correct
* generate the 8 variables: (you could also use define followed by let )
gen var11 = -1
..... etc until
gen var24 = -1
* the reason for the value -1 is that we wish to know if the variable is
changed later.
Sort id visit
* now we can move the values to the correct variable: (shown for the
var11..var14)
if visit = 1 then var11 = var1
if visit = 1 then var12 = var1[_n+1]
if visit = 1 then var13 = var1[_n+2]
if visit = 1 then var14 = var1[_n+3]
* and similarly for the var2x variables
browse // to see visually that it works
* all values have now been copied from four records to the first record
for each person
select visit = 1
labeldata "My combined file in wide format"
savedata newfile
The principle above can be used for many conversions. E.q. for first
and follow up visit:
* assume bmi indicates body mass index. And we wish to test for bmi
change by sex:
gen bmidif = .
if (visit = 1) and (id = id[_n+1]) then bmidif = bmi[_n+1] - bmi
means bmidif sex // for testing in version 2 add /t
The next question could be "How to get from wide to long format" -
The reverse of what Hans wanted. This would not be quite as easy, but
something like
generate 400 // an empty file first, e.g. 100 observations with four
records
gen i s = _n // instead of _n recnumber can be used
gen i id = 1
if (s mod 4) = 0 and (recnumber > 4) then id = id[_n-4] + 1
* plus some more logic to get the id numbers right.
* then the data could be added by "relate" and subsequently moved to the
correct variables
regards
Jens Lauritsen
Marcel extended the example by asking:
Is there a way to make sure that the data set is sorted to be sure that
the assumption: "* We assume that the order of visits in set12 is
chronological,
holds" ?
I recommend having a time in the "visits record", preferably:
e.g. datevisit, but also a sequential number in patient follow up
studies, e.g.visit 1=start 2=4monts 3=12 months 4=2years etc.
In real empirical data it usually happens that one or more visits are
either missed or taking place at a point in time not exactly being on
time. E.g. how to designate a visit 5 monts after initial treatment in a
study where visits are supposed to be at 4 and 6 months. Sequence often
indicates certain tests (e.g. blood samples) which vary by visit, e.g.
more expensive ones less often, such as x-rays. By using as well the
date and the sequence we can know exactly what are the data, which
variables are missing and what is the time difference from "supposed
time of visit".
Therefore careful planning obviously remedies this by having the
possibility to sort as well on sequence and date.
sort id visit
In the control of such data I would always:
read rawdata
*suppose we need 4 visits per person, numbered 1 2 3 4
* 1+2+3+4=10
aggregate studyid /sum="visit" /close
gen i ok=(sumvisit=10)
list studyid visit if ok <> 1
* or the same in "epi6" mode:
read rawdata
aggregate .... as above...
define ok #
let ok = 0
if (sumvisit = 10) then ok = 1
select if ok <> 1
list studyid
select
regards
Jens Lauritsen
I have a parent SET1.REC, containing a key unique identifier ID and AGE
and SEX, related to child SET2.REC, containing VAR1 and VAR2
In analysis, I create SET12.REC that has now as many records as SET2
(ID, AGE, and SEX) repeated for each record up to as many times as there
are values for VAR1 and VAR2. If SET1 actually represents the
individuals identified by ID, and SET2, e.g., visits for ID, and I wish
now to make a NEW.REC containing only as many records as there are IDs,
but making new variables VAR11, VAR21, VAR12, VAR22, and VAR13, VAR23,
VAR14, VAR24 (if there are up to 4 visits for each ID, HOW would one
thus write an EpiData Analysis command set to get from:
SET12.REC
ID AGE SEX VAR1 VAR2
to
NEWSET.REC
ID AGE SEX VAR11 VAR21 VAR12 VAR22 VAR13 VAR23 VAR14 VAR24
(where I know there is a maximum of 4 visits per ID)
with only ID number of records?
Thank you for any input you might have,
Hans
--
Hans L Rieder, MD, MPH
Jetzikofenstr. 12
3038 Kirchlindach
Switzerland
Tel: +41 31 829 4577
Mob: +41 79 321 9122
Web: http://www.tbrieder.org
bonjour
veullez ne plus m'envoyer de messages!!!merci
----- Message d'origine ----
De : "epidata-list-request(a)lists.umanitoba.ca" <epidata-list-request(a)lists.umanitoba.ca>
À : epidata-list(a)lists.umanitoba.ca
Envoyé le : Mardi, 24 Avril 2007, 19h03mn 39s
Objet : EpiData-list Digest, Vol 42, Issue 14
Send EpiData-list mailing list submissions to
epidata-list(a)lists.umanitoba.ca
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.umanitoba.ca/mailman/listinfo/epidata-list
or, via email, send a message with subject or body 'help' to
epidata-list-request(a)lists.umanitoba.ca
You can reach the person managing the list at
epidata-list-owner(a)lists.umanitoba.ca
When replying, please edit your Subject line so it is more specific
than "Re: Contents of EpiData-list digest..."
EpiData-list mailing list
___________________________________
Today's Topics:
1. Is there any way to import from Excel to EpiData?
(epidata-list(a)lists.umanitoba.ca)
2. Re: Is there any way to import from Excel to EpiData?
(epidata-list(a)lists.umanitoba.ca)
----------------------------------------------------------------------
Message: 1
Date: Tue, 24 Apr 2007 10:48:18 +0200
From: epidata-list(a)lists.umanitoba.ca
Subject: [EpiData-list] Is there any way to import from Excel to
EpiData?
To: <epidata-list(a)lists.umanitoba.ca>
Message-ID:
<939234DEF7B61C48B044D11A67E61B748A3EDE(a)mdmexch.medecinsdumonde.net>
Content-Type: text/plain; charset=iso-8859-1
Hello everyone. I understand from the user manuals that data can be imported from text, dbase, and STATA. Has anyone figured out a way to import an Excel database, even though technically it is not an option?
Thank you
Todd
Services Technique d'Appui aux Opérations (STAO)
Médecins du Monde - France
62 rue Marcadet
75018 Paris - France
Tél: +33 (0)1 44 92 16 18
------------------------------
Message: 2
Date: Tue, 24 Apr 2007 05:41:32 -0700 (PDT)
From: epidata-list(a)lists.umanitoba.ca
Subject: Re: [EpiData-list] Is there any way to import from Excel to
EpiData?
To: epidata-list(a)lists.umanitoba.ca
Message-ID: <467108.92422.qm(a)web43141.mail.sp1.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1
You can save the Excel file as a .dbf file, then import the .dbf file into Epidata. I assume you'll need to add variable names in the first row of the Excel file.
Richard Herrell
NIMH
epidata-list(a)lists.umanitoba.ca wrote:
Hello everyone. I understand from the user manuals that data can be imported from text, dbase, and STATA. Has anyone figured out a way to import an Excel database, even though technically it is not an option?
Thank you
Todd
Services Technique d'Appui aux Opérations (STAO)
Médecins du Monde - France
62 rue Marcadet
75018 Paris - France
Tél: +33 (0)1 44 92 16 18
_______________________________________________
EpiData-list mailing list
EpiData-list(a)lists.umanitoba.ca
http://lists.umanitoba.ca/mailman/listinfo/epidata-list
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
------------------------------
________________________________________
EpiData-list(a)lists.umanitoba.ca
http://lists.umanitoba.ca/mailman/listinfo/epidata-list
End of EpiData-list Digest, Vol 42, Issue 14
********************************************
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
Hello everyone. I understand from the user manuals that data can be imported from text, dbase, and STATA. Has anyone figured out a way to import an Excel database, even though technically it is not an option?
Thank you
Todd
Services Technique d'Appui aux Opérations (STAO)
Médecins du Monde - France
62 rue Marcadet
75018 Paris - France
Tél: +33 (0)1 44 92 16 18
Hi,
I wrote introductory guideline for EpiData at Karolinska Institute,
Stockholm. Now I am in Johannesburg for data collection, will spend
around 10 months here. People working in bioinformatics are interested
in learning more about EpiData and was asked to present about
database.
Anyone living in Johannesburg and interested in joining to teach EpiData?
Best regards
ziad
--
Ziad El-Khatib
AIDS Unit
National Institute for Communicable Diseases (NICD)
1 Modderfontein Road
Private Bag X4, Sandringham, 2131
Johannesburg, South Africa
Mobile: +27 (0) 72-52 39 716
Phone: +27 (0) 11-386 6433
Fax: +27 (0)11 386 6453
http://www.nhls.ac.za/div_nicd.html
Division of International Health (IHCAR)
Karolinska Institutet
www.phs.ki.se/ihcar
>
> >I would like to know how one could change the confidence Interval (CI)
> to reflect 90% instead of 95% which I assume is the default. I am
> working in Epidata Analysis V2.0 (build 108).
>
>
The command "set table CI HEADER="(90% CI)" only changes the text in the
tables, not the calculation. Until now the statistics have NOT been
adapted to other confidence intervals than 95%. For a given table it
should be quite easy though given you have the raw numbers. Enter these
into e.g. www.openepi.com and get the desired 90% CI.
For analysis the possibility of users defining CI (e.g. 90 95 99) could
be implemented within the next few years.
Just now for the v2 of EpiData Analysis we are working on some "subtle"
internal issues, which is why seemingly very little progress was made
recently. The implementation of the Upper Case fields <AAAAA> revealed
need for quite many changes, since all internal parts were made only for
uppercase handling. The problems mentioned in the Mantis database and
on the www.epidata.dk/testing.php page that the latest test build does
not save data properly has been solved.
Regards Jens Lauritsen
EpiData Association
Hi again
I sent a request on the this earlier but I don't know if everyone was
on holiday because I didn't get any response:-)! So I am trying again!
I would like to know how one could change the confidence Interval (CI)
to reflect 90% instead of 95% which I assume is the default. I am
working in Epidata Analysis V2.0 (build 108).
If one uses the command: Set TABLE CI HEADER="(90% CI)", it does change
the header to reflect 90% but the actual CI values still stays the same.
I also need to get the Fischer Exact p value, as well as the CI values
as part of my table output. I looked in the help function and the
command options do not seem to match up with the explanations. There is
supposed to be an option that says 'add an extra table with a summary of
chi square, p values etc' but I can't find the appropriate command on
the LHS. I have been able to get the Fischer's exact p by using the
command /EX but the command /CI didn't give me any confidence
intervals.
Please let me know if there is a flaw in my logic as I am not a stats
expert.
Thanks.
Regards
Juanette John
--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre(a)csir.co.za.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
AS some of you might have noticed I have already defined an open EpiData
site - in the form of a wiki - where some experiences on using this
technology already exist.
The www.epidata.org site has been reserved by me a few years back with the
intention that this could serve as the "community" site for EpiData,
maintained collectively by the body of epidata users.
Pedro Arias and I created teaching material for use in the Canadian Field
Epi course last autumn. Off list I have suggested to a number of users
mentioning materials to add these to the site, but the time and energy to
get onto a new way of working can be difficult to find for already busy
people. If the material already exist it is quite easy to copy and paste
into the wiki and upload the figures/images.
The experimental site is found at http://www.epidata.org/wiki
There is some learning problems in the beginning when editing in the wiki
format, but with a few experiments it works very well. An introduction is
shown at http://en.wikipedia.org/wiki/Wikipedia:How_to_edit_a_page
The optimal would be that a group of persons together take on the
responsibility of maintaining the open site, since we must unfortunately
expect that someone will add irrelevant material or suggestions which
otherwise are not appropriate. The initial steps of forming such a group
has been made, but awaits further initiatives.
Kind regards
Jens Lauritsen
--
Jens Lauritsen
Coordinator and initiator of EpiData Project
http://www.epidata.dk
Thanks for the link. I was interested to see the Epidata training materials on this site and also the ones now on the Epidata website. I'd be very interested in any other links. I'm especially interested in materials that deal with outbreaks so it was great to see the case study about Tiramisu on the epidata website - but that only deals with the analysis side. (Here we use Epidata for our questionnaires and data entry but use Epi Info for analysis).
I've done a training manual for our public health staff about using Epidata and have an outbreak case study exercise that uses epidata and epi info, but have not made on line versions yet. I would be interested in talking to others - perhaps off line about materials they use for epidata training.
thanks again
Christine
Christine Roseveare
Analyst
Regional Public Health
570 9194
027 495 9671
>>> <epidata-list(a)lists.umanitoba.ca> 13/04/2007 5:26 p.m. >>>
Have a look at the many available documentations on the web.
A similar thing (calculating age from date of birth) is included on page 6 of a very useful intro (A brief overview of EpiData software) to be found on http://www.tbrieder.org/ (follow icon to "Revised EpiData course")
marcel
-----Ursprüngliche Nachricht-----
Von: epidata-list(a)lists.umanitoba.ca [mailto:epidata-list@lists.umanitoba.ca]
Gesendet: Donnerstag, 12. April 2007 14:13
An: epidata-list(a)lists.umanitoba.ca
Betreff: [EpiData-list] BMI Calculation
Thanks.
I just recently started using Epidata, and I need some help on creating a Check string for automatically calculating BMI using Weight and Height (in pounds and feet/inches). Thanks, again.
--
Ali B. Mansaray
MANSA Consulting Services
6530 Davidson Road
Columbia, SC 29209
803-381-6864
ali.mansaray(a)gmail.com
--
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 **