For an ideal $I$ in a commutative ring $R$, define codimension$=dim(R)-dim(R/I)$. Does codimension equals height for all ideals in the formal power series ring. Does this hold for complete local domains in general?
The standard definition of codimension of $R/I$ is the height of $I$.
Anyway, a first observation is $\dim R - \dim R/I=ht(I)$ for all $I$ is equivalent to require the equality for all prime ideals. So let $P$ be a prime ideal in $R$ and you want $$ \dim R = \dim R/P + ht(P).$$ This is true for any local Cohen-Macaulay ring. If you take a formal power series rings with coefficients in a field and finitely many variables, then it is regular, hence Cohen-Macaulay. Another class of rings for which the egality holds are Noetherian local catenary integral domains (this includes the Noetherian complete local domains).
If $R$ is not a domain, there are easy counterexamples (e.g. if the spectrum of $R$ has two irreducible components and if they have distinct dimensions).