The impact of R&D on value added for domestic and foreign firms in a newly industrialized economy