How to define Jumps at a variable using another variable
Hi all,
Please help me on how I can define this jumps.
Variable a04 is exact age of respondent while variable a06 is another question. Variable a06 is only applicable to respondents whose age range is 0-18 otherwise a jump is required to variable a08. This is what I have done below but I keep getting error message.
Kindly help on how I can achieve the jumps.
Thank you.
Bola Adedoyin (Mrs) DC Pro-Data Consult Lagos, Nigeria
a06 BEFORE ENTRY define tempv # IF a04 RANGE 0 18 THEN tempv=1 ELSE tempv=2 ENDIF tempv JUMPS 2 a08 END END END END
Bola, there might be several problems here:
1) best make the conditional statement right after the data have been entered into the field: a4 AFTER ENTRY IF .... THEN .... ENDIF END END
2) "THEN" must be the last word on the line, what is to happen gets into the next line
3) I don't think a RANGE works within a conditional statement, bu this is also not necessary here, simpler is: IF a4<18 THEN GOTO X ENDIF
4) I don't think you can define a new variable in a field, this should be done outside a field, like in a BEFORE FILE statement:
BEFORE FILE DEFINE tempv # END
5) Not essential, but perhaps also try GOTO instead of jumps
There might be some other issues as well, but difficult to judge from the small excerpt.
Hans
On 20:59, epidata-list@lists.umanitoba.ca wrote:
Hi all,
Please help me on how I can define this jumps.
Variable a04 is exact age of respondent while variable a06 is another question. Variable a06 is only applicable to respondents whose age range is 0-18 otherwise a jump is required to variable a08. This is what I have done below but I keep getting error message.
Kindly help on how I can achieve the jumps.
Thank you.
Bola Adedoyin (Mrs) DC Pro-Data Consult Lagos, Nigeria
a06 BEFORE ENTRY define tempv # IF a04 RANGE 0 18 THEN tempv= ELSE tempv=2 ENDIF tempv JUMPS 2 a08 END END END END
You should do this with GOTO as Hans suggests:
a06 before entry if (a04 >=0 and a04 <=18) then goto a08 endif end end
blocks that begin with a variable name cannot appear within the block for another variable. If you need to use the variable tempv elsewhere, then include this at the top of your check file
before file define tempv # global end
Jamie
On 2010-08-05, at 7:25 AM, epidata-list@lists.umanitoba.ca wrote:
Variable a04 is exact age of respondent while variable a06 is another question. Variable a06 is only applicable to respondents whose age range is 0-18 otherwise a jump is required to variable a08. This is what I have done below but I keep getting error message.
Kindly help on how I can achieve the jumps.
Thank you.
Bola Adedoyin (Mrs) DC Pro-Data Consult Lagos, Nigeria
a06 BEFORE ENTRY define tempv # IF a04 RANGE 0 18 THEN tempv=1 ELSE tempv=2 ENDIF tempv JUMPS 2 a08 END END END END
Hello,
I am trying to analyze data for an outbreak. I am trying to run 2x2 tables for 50 food items. After running about 40 tables, the results viewer window refreshes and then only shows the later 10 tables. I am unable to scroll up to find the results for the first 40 tables. How do I retrieve that information? How do I view the results for all 50 of the tables?
Thanks in advance for your input.
Sandy -------------------------------- Sandy Goeke, MPH sandy.goeke@co.benton.or.us
Three ways: a. use condensed table format: tab casevar exp1 exp2 exp3 ......exp50 /oa
b. Open a logfile, e.g. logopen outbreak.htm tab casevar exp1 exp2 exp3 ......expn /oa logclose * Then you can view the file outbreak.htm in your standard browser.
c. If you prefer single tables rather than the condensed one: Select 25 variables at a time
regards
Jens Lauritsen EpiData Association
I am trying to analyze data for an outbreak. I am trying to run 2x2 tables for 50 food items. After running about 40 tables, the results viewer window refreshes and then only shows the later 10 tables. I am unable to scroll up to find the results for the first 40 tables. How do I retrieve that information? How do I view the results for all 50 of the tables?
Thanks in advance for your input.
Sandy
Sandy Goeke, MPH sandy.goeke@co.benton.or.us
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
Thanks for the suggestions on creating condensed tables.
As you know, I am trying to learn how to use EpiData Analysis by practicing with a previous outbreak that occurred. However, I'm running into some troubles with the calculations. I wonder if I'm missing a command or doing something wrong.
For example:
I have 65 records. 13 cases. 51 controls. 1 excluded.
When I type:
Freq item03c
Item03c
N
Y
18
N
27
Total
45
When I type:
Tab status item03c
Status
Item03c
Case
Control
Total
Y
9
9
18
N
3
24
27
Total
12
33
45
So far, this matches with the data in my .dbf file. I manually counted exposed/unexposed & case/control for item03c.
When I type:
Tab status item03c/oa
Outcome: status by item03c
Status by item03c
Exposed
Not Exposed
N
n
Ill
AR(%)
N
n
Ill
AR(%)
RR
(95% CI)
45
27
24
88.9
18
9
9
50
1.78
(1.10-2.88)
Exposure: (Item03C=N)
Outcome: Status=control
I think there is something wrong with these calculations. It seems that the wrong numbers are being used to calculate the AR and RR. Why in this table does it have exposed n=27 instead of exposed n=18 and exposed Ill=24 instead of exposed Ill=9 and vice versa with the not exposed values? When I manually calculated these numbers in a 2x2 table, I assumed that the table would look like this and the calculations are these:
Status
Case
Control
Total
AR(%)
RR
Exposed
9
9
18
50
4.5
Not exposed
3
24
27
11
Total
12
33
45
What am I doing wrong? Do you have suggestions for my problem?
Thanks,
Sandy
--------------------------------
Sandy Goeke, MPH
sandy.goeke@co.benton.or.us
-----Original Message----- From: epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list@lists.umanitoba.ca Sent: Monday, August 09, 2010 11:46 PM To: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] How to define Jumps at a variableusing anothervariable
Three ways:
a. use condensed table format:
tab casevar exp1 exp2 exp3 ......exp50 /oa
b. Open a logfile, e.g.
logopen outbreak.htm
tab casevar exp1 exp2 exp3 ......expn /oa
logclose
* Then you can view the file outbreak.htm in your standard browser.
c. If you prefer single tables rather than the condensed one:
Select 25 variables at a time
regards
Jens Lauritsen
EpiData Association
I am trying to analyze data for an outbreak. I am trying to run 2x2
tables for 50 food items. After running about 40 tables, the results
viewer window refreshes and then only shows the later 10 tables. I am
unable to scroll up to find the results for the first 40 tables. How
do
I retrieve that information? How do I view the results for all 50 of
the
tables?
Thanks in advance for your input.
Sandy
Sandy Goeke, MPH
sandy.goeke@co.benton.or.us
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
_______________________________________________
EpiData-list mailing list
EpiData-list@lists.umanitoba.ca
This does seem odd as the TAB command takes as default the higher values of the variables to mean "case" and "exposed". However, the info at the bottom of your tables shows that it is taking (Item03C=N) as exposed and Status="control" as the outcome.
Try this with adding to the end of the command: /sa This reverses the order of values. Do you have the latest version of Analysis?
This was always a problem with EpiData as well - getting the values in the right order for both Jamie Hockin
On 2010-08-11, at 1:53 PM, Sandy wrote:
As you know, I am trying to learn how to use EpiData Analysis by practicing with a previous outbreak that occurred. However, I'm running into some troubles with the calculations. I wonder if I'm missing a command or doing something wrong.
Hi Jamie, Thanks for the suggestions. The command: /sa worked. Will this always be the case? Will I always have to reverse the values? Why is the program taking the higher values of the variables to mean case and exposed as the default setting? I do have the latest version of analysis. Sandy
-----Original Message----- From: epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list@lists.umanitoba.ca Sent: Wednesday, August 11, 2010 3:35 PM To: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] outbreak table and calculations
This does seem odd as the TAB command takes as default the higher values of the variables to mean "case" and "exposed". However, the info at the bottom of your tables shows that it is taking (Item03C=N) as exposed and Status="control" as the outcome.
Try this with adding to the end of the command: /sa This reverses the order of values. Do you have the latest version of Analysis?
This was always a problem with EpiData as well - getting the values in the right order for both Jamie Hockin
On 2010-08-11, at 1:53 PM, Sandy wrote:
As you know, I am trying to learn how to use EpiData Analysis by practicing with a previous outbreak that occurred. However, I'm
running
into some troubles with the calculations. I wonder if I'm missing a command or doing something wrong.
_______________________________________________ EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
Sandy asks why particular defaults were chosen for the tables command and outbreak analysis.
The reason is simple - we had to make a decision and usually I tend to work with 1 being indicator of a given status, e.g. case or exposure and 0 being the "non-case" or "non-exposure". As simple as that, in other words it is a matter of preference.
I could have argued that we went over several epidemiological text books and found the most common choice of values. But the reality is that there is no uniform standard we could use.
The import decision is therefore to be very specific about how the values are interpreted and used. - and to add options - e.g. the /SA option - for further control by users. It is good practice to study the command reference for the commands you are using. Many options exist and are thoroughly explained in the command reference, which you find in the help menu of analysis.
The key design choice in all commands is to document exactly the codes used. You should also notice that in all commands the number of informative observations and the number of total observations is always readily seen in the output. Should there be a command, where this is not the case let us know on the list or report to the flyspray database.
Regards Jens Lauritsen EpiData Association On 12-08-2010 18:39, epidata-list@lists.umanitoba.ca wrote:
Hi Jamie, Thanks for the suggestions. The command: /sa worked. Will this always be the case? Will I always have to reverse the values? Why is the program taking the higher values of the variables to mean case and exposed as the default setting? I do have the latest version of analysis. Sandy
The default is higher for those who code 1=yes, 0=no. This SHOULD be the same for Y,N. Jamie
On 2010-08-12, at 12:39 PM, epidata-list@lists.umanitoba.ca wrote:
Hi Jamie, Thanks for the suggestions. The command: /sa worked. Will this always be the case? Will I always have to reverse the values? Why is the program taking the higher values of the variables to mean case and exposed as the default setting? I do have the latest version of analysis. Sandy
participants (1)
-
epidata-list@lists.umanitoba.ca