From Julian Matthewman psoriasis and dementia: https://github.com/julianmatthewman/psoriasis_dementia_public: 

created using revised codes from Harriet Forbes, reviewed by CWG 
cleaning do file can be found here 