The Brazilian limped out of the Madejski Stadium last Saturday after being substituted at half-time against Reading.
The former Porto player had been enjoying a good run of form in recent weeks.
United boss Sir Alex Ferguson said: "It is a hamstring. It will be three or four weeks. It is not serious but it is a hamstring."
Anderson will miss the derby showdown against Premier League champions Manchester City on Sunday but should be back comfortably in time for the visit of Liverpool on January 13.