Logic of Survey Analysis