Chemometric methods for spectroscopy-based pharmaceutical analysis