Multilevel flexible specification of the production function in health economics