  Let $k$ be an algebraically closed field of characteristic $p>0$. Let $c,d,m$
be positive integers. Let $D$ be a $p$-divisible group of codimension $c$ and
dimension $d$ over $k$. Let $\scrD$ be a versal deformation of $D$ over a
smooth $k$-scheme $\scrA$ which is equidimensional of dimension $cd$. We show
that there exists a reduced, locally closed subscheme $\grs_D(m)$ of $\scrA$
that has the following property: a point $y\in\scrA(k)$ belongs to
$\grs_D(m)(k)$ if and only if $y^*(\scrD)[p^m]$ is isomorphic to $D[p^m]$. We
prove that $\grs_D(m)$ is {\it regular and equidimensional} of {\it dimension}
$cd-\dim(\pmb{\text{Aut}}(D[p^m]))$. We give a proof of {\it Traverso's
formula} which for $m>>0$ computes the codimension of $\grs_D(m)$ in $\scrA$
(i.e., $\dim(\pmb{\text{Aut}}(D[p^m]))$) in terms of the Newton polygon of $D$.
We also provide a criterion of when $\grs_D(m)$ satisfies the {\it purity
property} (i.e., it is an affine $\scrA$-scheme). Similar results are proved
for {\it quasi Shimura $p$-varieties of Hodge type} that generalize the special
fibres of good integral models of Shimura varieties of Hodge type in unramified
mixed characteristic $(0,p)$.
