Whether you are the attacker or the defender your troop has offensive, defensive and health statistics and all 3 come into the calculation no matter whether your town is the attacker or the defender. So just because your town is the attacker that does not mean that your defensive statistics are not counted and just because the other town is the defender that does not mean that their offensive statistics are not counted.
Now there are statistics that you can gain in the Oracle that are only counted if you attack or if you defend ... under military ...
Just used when attacking are:
Troop Offense During an Attack
Troop Defensive During an Attack
Troop Health During an Attack
Just used when defending are:
Troop Offense During Defense
Troop Defensive During Defense
Troop Health During Defense
Also there is equipment that adds offensive, defensive and health bonus that only come into the calculation if you are attacker (saracen) or if you are the defender (lynx).
So after all that, lol, ALL those increase your troop offensive bonuses and increase your troop defensive bonuses and decrease your opponents troop offensive bonuses and decrease your opponents troop defensive bonuses come into the calculation whether you are the attacker or the defender.