The Ph.D. thesis by Ton de Waal examines two different areas: detection of erroneous data and protection of sensitive data.By assuming that as few errors as possible have been made while answering and processing the questionnaires, the detection of erroneous data can be formulated as a mathematical optimisation problem. In the thesis a number of methods are developed to solve this optimisation problem efficiently. Sensitive data of individual respondents or small groups of respondents have to be protected, for instance by not publishing these data. In the thesis several mathematical problems with respect to protecting sensitive data are explored. For a number of problems, such as calculating the information loss due to protecting sensitive data and minimising the information that is not published, solutions are presented.