A good *positive reinforcement* trainer, or a good reactive dog class, can help your dog A LOT. I took my dog through such a class after he was attacked.
Can your dog walk normally on the carpet? I might worry about some joint problems, or a degenerative spinal condition, in addition to the anxiety. Even low thyroid. You might also trim the fur around the paw pads for better traction.