Anderson, a Tucson native, hit a two-run triple in the first inning, a double in the second, a two-run single in the third, and a two-run homer in the fourth. He doubled in the fifth.
The Royals finished with 27 hits while the Diamondbacks had 12.
Royals starter Brian Bannister threw four shutout innings, striking out three and walking one.
The Diamondbacks Billy Buckner, a candidate for the rotation, allowed eight runs and nine hits in two innings. He struck out three and walked one.