A disease due to deficiency of niacin, a B-complex vitamin, or its precursor tryptophan. It is characterized by scaly dermatitis which is often associated with diarrhea and dementia (the three D's).