error in CHK file: cannot apply opGTE to missing operands
Hi
I receive the following error with the CHK file coding that follows:
CHECK MOUS >= MOUSTR cannot apply opGTE to missing operands
And here's the coding:
CONSISTENCYBLOCK CHECK "impossible # treated nets" MOUS >= MOUSTR CHECK "impossible # children sleeping under nets" ENFANTS >= DORMI END
I cannot figure out why this is. MOUS, MOUSTR, ENFANTS and DORMI are all names for numerical variables in the REC file. Any assistance (however obvious) would be helpful.
Thank you,
Ruwan
Allow for missing data and put this first in the logic. Then the comparison should be OK. What I show is that you allow either MOUS or MOUSTR to be missing and then the comparison is not necessary.
CONSISTENCYBLOCK CHECK "impossible # treated nets" ((mous=.) or (moustr=.) or (MOUS >= MOUSTR)) CHECK "impossible # children sleeping under nets" ((enfants=.) or (dormi=.) or (ENFANTS >= DORMI) END
If you do not allow only one of the fields to be missing, you have to run the following first and fix all the records that do not comply:
consistencyblock check "Inappropriate missing values for MOUS or MOUSTR" ((mous<>.) and (moustr<>.)) end
This is easy to do in Analysis, but you still have to be careful about missing values, because you cannot trust the result of < or > on a missing value. In Analysis, of course, your intention is to select bad records, so the logic is reversed.
read yourdata select (mous<>.) and (moustr<>.) and (MOUS<MOUSTR) list id mous moustr select select (enfants<>.) and (dormi<>.) and (enfants<dormi) list id enfants dormi select
Jamie
On 2011-09-15, at 5:54 AM, epidata-list@lists.umanitoba.ca wrote:
I receive the following error with the CHK file coding that follows:
CHECK MOUS >= MOUSTR cannot apply opGTE to missing operands
And here's the coding:
CONSISTENCYBLOCK CHECK "impossible # treated nets" MOUS >= MOUSTR CHECK "impossible # children sleeping under nets" ENFANTS >= DORMI END
Many thanks for this quick response..!
Ruwan
On 9/15/11, epidata-list@lists.umanitoba.ca epidata-list@lists.umanitoba.ca wrote:
Allow for missing data and put this first in the logic. Then the comparison should be OK. What I show is that you allow either MOUS or MOUSTR to be missing and then the comparison is not necessary.
CONSISTENCYBLOCK CHECK "impossible # treated nets" ((mous=.) or (moustr=.) or (MOUS >= MOUSTR)) CHECK "impossible # children sleeping under nets" ((enfants=.) or (dormi=.) or (ENFANTS >= DORMI) END
If you do not allow only one of the fields to be missing, you have to run the following first and fix all the records that do not comply:
consistencyblock check "Inappropriate missing values for MOUS or MOUSTR" ((mous<>.) and (moustr<>.)) end
This is easy to do in Analysis, but you still have to be careful about missing values, because you cannot trust the result of < or > on a missing value. In Analysis, of course, your intention is to select bad records, so the logic is reversed.
read yourdata select (mous<>.) and (moustr<>.) and (MOUS<MOUSTR) list id mous moustr select select (enfants<>.) and (dormi<>.) and (enfants<dormi) list id enfants dormi select
Jamie
On 2011-09-15, at 5:54 AM, epidata-list@lists.umanitoba.ca wrote:
I receive the following error with the CHK file coding that follows:
CHECK MOUS >= MOUSTR cannot apply opGTE to missing operands
And here's the coding:
CONSISTENCYBLOCK CHECK "impossible # treated nets" MOUS >= MOUSTR CHECK "impossible # children sleeping under nets" ENFANTS >= DORMI END
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
participants (1)
-
epidata-list@lists.umanitoba.ca