I have a fairly simple dataset in which a binary response is matched against drug dose:
What I am hoping to achieve is a determination on whether any of the doses are significantly different to control (dose=0)
If I try margins I get an error:
I tried margins, at(), but the output was nonsensical because the lowest dose groups cannot be significantly different:
Am I just barking up the wrong tree, trying to get an outcome that's simply not possible?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float dose int preg 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 85 1 85 1 85 1 85 1 85 1 85 1 85 1 85 1 85 1 85 1 85 1 85 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 250 1 500 1 500 1 500 1 500 1 500 1 500 1 500 1 500 0 500 0 500 0 500 0 500 0 end
Code:
. logit preg dose
Iteration 0: log likelihood = -18.084968
Iteration 1: log likelihood = -14.81676
Iteration 2: log likelihood = -14.003143
Iteration 3: log likelihood = -13.990435
Iteration 4: log likelihood = -13.990401
Iteration 5: log likelihood = -13.990401
Logistic regression Number of obs = 48
LR chi2(1) = 8.19
Prob > chi2 = 0.0042
Log likelihood = -13.990401 Pseudo R2 = 0.2264
------------------------------------------------------------------------------
preg | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dose | -.0071943 .002991 -2.41 0.016 -.0130565 -.001332
_cons | 4.138469 1.261881 3.28 0.001 1.665227 6.61171
------------------------------------------------------------------------------
Code:
. margins dose factor 'dose' not found in list of covariates r(322);
Code:
. margins, at(dose=(85,250,500))
Adjusted predictions Number of obs = 48
Model VCE : OIM
Expression : Pr(preg), predict()
1._at : dose = 85
2._at : dose = 250
3._at : dose = 500
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_at |
1 | .9714451 .0286189 33.94 0.000 .9153532 1.027537
2 | .9121283 .0512337 17.80 0.000 .811712 1.012545
3 | .6321235 .136214 4.64 0.000 .365149 .899098
------------------------------------------------------------------------------

Comment