A deficiency of niacin, also known as vitamin B3, causes pellagra. B3 deficiency can be caused by a dietary lack of niacin, seen in poor and malnourished farmers in the 1900s, or from poor absorption of niacin, observed with certain diseases or how the food is prepared.