  Let $K$ be an algebraically closed non-Archimedean field. Leonard Lipshitz
has introduced a manageable notion of subanalytic sets of the unit polydisc.
This class contains the class of affinoid sets and is stable under projection.
We associate to a subanalytic set its counterpart in the Berkovich polydisc.
This allows us to give a new insight to the dimension of subanalytic sets using
the degrees of the completed residual fields. With these methods we obtain new
results, such as the invariance of the dimension under subanalytic bijection in
any characteristic. Then we study more generally subsets $S$ of $K^m\times
\Gamma^n$ and of $K^m\times \Gamma^n \times k^p$ where $\Gamma$ is the value
group and $k$ the residue field. We allow $S$ to be either definable in ACVF,
or definable in the analytic language of L. Lipshitz. We define a dimension for
such sets $S$. In the case when $S \subset K^n$ (resp. $S\subset \Gamma^n$,
$S\subset k^n$), it coincides with the above dimension (resp. the o-minimal
dimension, the Zariski dimension). We prove that this dimension is invariant
under definable bijection and decreases under projection. This allows us to
generalize previous results on tropicalization of Berkovich spaces and to place
them in a general framework.
