An analysis of a large dataset on immigrant integration in Spain. The Statistical Mechanics perspective on Social Action