Approximate conditional inference in logistic and loglinear models