Anderson is in a nursing home and Nick Diaz is a washed up drunk/drug addict retired fighter, so it's hard to know who is the better boxer right now. But I would assume it's still old man Anderson, because the guy has won a fight in the last decade and isn't a drug addict.
And if you are referencing their primes, Anderson was clearly a better boxer than Nick. I mean, you do know a 40-year-old Anderson already fought Diaz and beat him easily, inclusive of punching him in the face repeatedly? Anderson was also incredibly durable throughout his career. Again, we don't know durable Diaz is now because he spends his days taking shots of Johnny Walker to the face, not shots in the cage/ring.
I hope you are just speculating a drunk can beat a geriatric (which is probably still silly), and don't think a prime Diaz was a better boxer than a prime Anderson, because that's 'Cowboy is a better striker than McGregor' level of analysis.