Econometrics of qualitative phenomena