I'm working with survey data on medication use among people with a disease. The question is whether people who know they have the disease are less likely to use medications that are contraindicated. We have a binary variable for whether people told the interviewer they had the disease (disease_aware), a variable for their disease severity (stage: mild, moderate, severe), and a binary variable for whether they take a specific contraindicated medication (med_use).

We use logistic regression to calculate predictive margins for taking the drug, then use -test- to determine whether, within each disease level, people who know they have the disease are less likely to take the drug.

We also want to present risk ratios with confidence intervals to describe how much less likely drug use is with disease awareness. We use -nlcom- to calculate those risk ratios. The problem is that we get very different answers from -test- and -nlcom- (which we then verified with -testnl- to get the p-value). With -test-, the p-value for margin1-margin2=0 is 0.0002, with -testnl-, the p-value for margin1/margin2=1 is 0.1815. See below for code and results.

I know that the two methods often don't give the exact same p-value, but I have never seen a case where the result is so wildly different. I've pasted code and results for the tests below. Am I missing some basic problem with the way I've structured the analysis? Thank you for any ideas you might have on why these results might be so different.



Code:
 
svy, subpop(if stage!=0): logistic med_use i.stage##i.disease_aware  other_variables

margins disease_aware, subpop(if stage!=0) over(stage) post

test _b[1.stage#0.disease_aware]=_b[1.stage_num#1.disease_aware] 

testnl _b[1.stage#0.disease_aware]/_b[1.stage_num#1.disease_aware] = 1

Results for -test- and -testnl- (I tried -testnl- on the test for margin1-margin2=0 to see if the problem could be explained as the Wald test vs the chi2, but the p-values were similar using -test- and -testnl-)

Code:
 
test _b[1.stage#0.disease_aware]=_b[1.stage_num#1.disease_aware] 
 ( 1)  1.stage#0bn.disease_aware - 1.stage#1.disease_aware = 0

       F(  1,    47) =   16.27
            Prob > F =    0.0002



testnl _b[1.stage#0.disease_aware]/_b[1.stage#1.disease_aware] = 1

  (1)  _b[1.stage#0.disease_aware]/_b[1.stage#1.disease_aware] = 1

               chi2(1) =        1.79
           Prob > chi2 =        0.1815


 testnl (_b[1.stage#0.disease_aware]-_b[1.stage#1.disease_aware] = 0)

  (1)  _b[1.stage#0.disease_aware]-_b[1.stage#1.disease_aware] = 0

               chi2(1) =       16.27
           Prob > chi2 =        0.0001