Random sampling with different stages

I'd appreciate some help solving this sampling issue:

I have select a random sample of people for a survey in a certain country.

The country is divided in 6 regions.

In total, there are 981 municipalities in those regions.

I have to select 5 municipalities from each region, for a total of 30 municipalities.

And then, I have to randomly select 30 people from each municipality.

Is there a way to do this in R or SPSS?

• Certainly there are ways. It's even straightforward to do it with pencil, paper, and a table of random numbers. But could you be more specific about what you mean by "randomly"? What probabilities do you want to use? That is, how do you want to weight the selections and why? – whuber Aug 15 '17 at 22:16
• By "randomly" I mean that there are 1.185.286 people in those 6 regions and 981 municipalities. But I only need to sample 900. – Chris Aug 15 '17 at 22:18
• Thank you--but that doesn't clarify things. Do you need to select each of those people with equal probability or not? – whuber Aug 16 '17 at 14:11
• @whuber, this is a very typical sampling design request. And getting equal probability of selection is approximately immaterial as you won't be able to analyze the data as if they were i.i.d. anyway because of clustering. – StasK Aug 17 '17 at 14:34

Your clusters, or primary sampling units (PSUs), are municipalities. I would select them with probabilities proportional to size. In R, this is to be done with library(sampling)... I would use sampling::UPmaxentropy() as the method that is closest to SRS in its statistical properties (and hence harder to screw up at the analysis stage, vs. say systematic sampling).
One of the problems I have encountered many times in international work is that once you took the sample, you (or your local contractors) destroyed all the records that you had used. This makes the data nearly unusable. To analyze the data properly (library(survey) in R; I wrote a chapter on this recently, as well), you need selection probabilities (and to construct these, you need the population counts at every stage) and identifiers of the strata and sampling units. You need to make absolutely sure that this information travels into your final data set.