Hello Epidata users, I am having problem to code conditional formula in epidata as described below, can anyone suggest how to code to the following condition,
If a= 1 and b = 1 then exposure= K
If a= 1 and b = 0 then exposure= K
If a= 1 and b = 1 and c= 1 then exposure= K
If a= 1 and b = 1 and c= 1 and d=0 then exposure= K
If a= 1 and b = 1 and c= 1 and d=1 then exposure= K
else exposure= K1
Thanks
Hello Epidata users, I am having problem to code conditional formula in
epidata as described below, can anyone suggest how to code to the following condition,
I think the problem is that you should use more parenthesis. Is this in analysis or in entry ?
I assume analysis:
* first create the integer variable k: define k # * or you could use the gen statement: "i" makes this an integer variable gen i k = 0
* give labels labelvalue k /0="No" /1="Yes" /9="Missing" /8="Not recoded"
* now for certain conditions change exposure to "no" or yes: * I just give different examples * first I give all the value 8 to make sure I am in control of the recoding: k = 8 If ( (a= 1) and (b = 1)) then exposure= 0 If ( (f = 1) ) then exposure= 9 If ( (a= 1) and (b = 1) and (c = 1) and (d = 1) ) then exposure= 1 tab k * if any records are stille with the value 8, then you would know there is a problem.
regards Jens Lauritsen EpiData Association
participants (1)
-
epidata-list@lists.umanitoba.ca