In some cases, data or materials cannot be released due to ethical or legal considerations. For instance, some data cannot be effectively stripped of personal information, or the copyright for some materials may not be owned by the authors of the paper. In many cases, the analysis code can be released even if the data cannot; the analysis code may still be checked in a limited way without the data, or used for later analyses on different data sets. Likewise, experimental code can be released without the stimulus materials, so that the experiment can be checked and run with other materials. If you are unsure whether or which parts of your data may be released, you may consult your local ethics committee.
In cases where some of data or materials cannot be released, clear and detailed justification for why the data or materials cannot be released should be outlined in the author note of the paper, or, if more space is needed, in an appendix or supplemental material referenced in the paper. The justification should make clear that all data and materials that could be released, were released.
For more reading on limits to scientific openness, see Chapter 3 of the Royal Society’s report “Science as an open enterprise”.