Roy missed the 3-1 one-day series win with back spasms and may face Ireland next week in order to show his fitness.
Harry Brook did not push his claim in Roy's absence, with scores of 25, two and 10.
"If Roy is not fit, I'm sure Brook will replace him but if Roy is fit, he definitely goes," said Anderson.
Roy, who was in the England team who won the World Cup in 2019, was in August named in a squad of 15 that selector Luke Wright said would defend the trophy in India in October and November.
However, since then, captain Jos Buttler and coach Matthew Mott have said there could be changes, with the squad set to be finalised next week.
After missing the first three matches of the series against New Zealand, Roy was part of the England warm-up before the final game at Lord's on Friday.
But when the team was named at the toss, Roy was again omitted, with Buttler saying he could play in the three-match series against Ireland, for which England have named a separate 13-man party.
Anderson, England's all-time leading wicket-taker, said on Test Match Special: "I saw Jason Roy on the field today, he was taking high catches and playing with a rugby ball and running around and he looked pretty much pain free.
"For me, he goes into that World Cup squad because I feel like he's played a big enough part over the last couple of years.
"He's been in decent nick when he has played. Brook wasn't in that initial squad and he's not done anything to make me think he has to go."
England play in the opening match of the World Cup against New Zealand in Ahmedabad on 5 October; their final squad has to be named by 28 September.
It could have been announced as early as this weekend, but Buttler said a delay is "absolutely" a help.
Pace bowler Mark Wood and leg-spinner Adil Rashid are also carrying injuries, though neither are thought to be a doubt for the World Cup.
"It allows us time to gather information," Buttler told Test Match Special. "When games are going on, it's a bit hard to know exactly where people are. Now the series is finished, it allows us to work out where everyone is at, or how we need to use that Ireland series. It will take a little bit of time."
Roy could be part of the first match against Ireland at Headingley on Wednesday.
Eoin Morgan, who was captain when England won the World Cup in 2019, told Sky Sports: "He has to play in the Ireland series because you can't sit in a selection meeting with any amount of confidence and pick him for the World Cup at the moment.
"He has to go through a certain level of game time, recuperation and then possibly another game to prove his fitness for the World Cup."
If Roy is fit to travel to the World Cup, it may now not be as part of the starting XI after Dawid Malan grabbed the chance to open the batting.
Malan's 127 in the fourth ODI against New Zealand followed scores of 54 and 96 earlier in the series. The left-hander reached 1,000 ODI runs in his 21st innings, a speed bettered only by three other batters in the history of the game.
"He's played brilliantly," said Buttler. "He's been very consistent every time he's had his opportunity.
"He can play in a couple of different styles, opening the batting or at number three as well. We know he's got that game. We've asked it of everyone to try and be a bit more aggressive and he's certainly showed that as well today."