The error appears to be caused by the fact that the data6 is not of the numeric class. Based on what I understand, you used SCAN and manually entered the values for data6 (which must be numerical). If so, what is the variable data6? And why did you choose data6=data? Data6 overrides whatever value you created in data6 using scan if it is another variable (and must not be a numeric one) and I assume that is why there is a problem. I would be glad to assist further if you need it. Thanks.