On the determination of appropriate dimensionality in data with error