Hello Allin...
 My script is working fine but not for all data files. I've attached files
 for which it doesn't work and script file.
 Why is it so? 
Hello...
I think that I've found the reason. Once of the variables (m) have to many 
missing values....
Best wishes,
Mariusz