Hello, I have a large dataset that I need to clean prior to analysis. The dataset contains 84 variables related to scores on an exam. The scores should range between 50 and 500 but there are instances when values can be outside of than range. I need to reduce the influence of these outlying scores by changing the values to the next highest value in the dataset that is within range. Here is a small sample: Subj Var1 1 20 2 520 3 55 4 490 5 19 If the code works then I should end up changing subjects' 1 & 5scores for Var1 to 55 (next lowest value within the range 50 - 500) and subjects 2 scores for Var1 to 490 (the next hightest value within range). There can be multiple subjects that have scores below 50 or above 500. Thanks for your help!
... View more