I processed one country with TPI, and I got a certain Landforms classification of terrain. (Topographic Position Index (TPI) calculation as proposed by Guisan et al. (1999)). When I processed only one municipality around that state with TPI, I got a different result, in fact more detailed. The calculation parameters were the same. This worries me because I thought to analyze the whole country, and then I would use the zonal statistics tools for each municipality individually and make conclusions based on the obtained forms of the field. I am writing a scientific paper in this field, so I really care about real data.
I found out what the problem was. I have square DEM. The state has curved boundaries. All pixels across the boundary have a value of 0 (was clipped). The TPI algorithm counted these pixels as well, and so I got such a result. I clipped again my country and removed pixels with a value of 0 and got a satisfactory result.