Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Setup for Survey Sampling--Example 9.4 from Scheaffer


From   Susan Cochran <[email protected]>
To   [email protected]
Subject   st: Setup for Survey Sampling--Example 9.4 from Scheaffer
Date   Wed, 26 Oct 2005 11:43:32 -0700 (PDT)

Hi, all,

Can you help? I can't get this to produce the right estimate.

I am trying to get Stata 9 to reproduce the analysis of Table 9.1 In Scheaffer et al., 6th edition, p. 307.

There are 90 plants, 10 are sampled SRS without replacement at the first stage, and within plants machines (m) are sampled SRS without replacement and measured for the hours of being broken. The known population size is about 4500 machines. M=number of machines in the plant sampled.

The calculations by hand reveal a mean of 4.8 hours.

I created a raw data file with the following structure

plant M m hours nplant nmach p1 p2 pwt
1 50 10 5 90 4500 9.00 5 45
1 50 10 7 90 4500 9.00 5 45
1 50 10 9 90 4500 9.00 5 45
1 50 10 0 90 4500 9.00 5 45
1 50 10 11 90 4500 9.00 5 45
1 50 10 2 90 4500 9.00 5 45
1 50 10 8 90 4500 9.00 5 45
1 50 10 4 90 4500 9.00 5 45
1 50 10 3 90 4500 9.00 5 45
1 50 10 5 90 4500 9.00 5 45
2 65 13 4 90 4500 9.00 5 45
2 65 13 3 90 4500 9.00 5 45
2 65 13 7 90 4500 9.00 5 45
2 65 13 2 90 4500 9.00 5 45
2 65 13 11 90 4500 9.00 5 45
2 65 13 0 90 4500 9.00 5 45
2 65 13 1 90 4500 9.00 5 45
2 65 13 9 90 4500 9.00 5 45
2 65 13 4 90 4500 9.00 5 45
2 65 13 3 90 4500 9.00 5 45
2 65 13 2 90 4500 9.00 5 45
2 65 13 1 90 4500 9.00 5 45
2 65 13 5 90 4500 9.00 5 45
3 45 9 5 90 4500 9.00 5 45
3 45 9 6 90 4500 9.00 5 45
3 45 9 4 90 4500 9.00 5 45
3 45 9 11 90 4500 9.00 5 45
3 45 9 12 90 4500 9.00 5 45
3 45 9 0 90 4500 9.00 5 45
3 45 9 1 90 4500 9.00 5 45
3 45 9 8 90 4500 9.00 5 45
3 45 9 4 90 4500 9.00 5 45
4 48 10 6 90 4500 9.00 4.8 43.2
4 48 10 4 90 4500 9.00 4.8 43.2
4 48 10 0 90 4500 9.00 4.8 43.2
4 48 10 1 90 4500 9.00 4.8 43.2
4 48 10 0 90 4500 9.00 4.8 43.2
4 48 10 9 90 4500 9.00 4.8 43.2
4 48 10 8 90 4500 9.00 4.8 43.2
4 48 10 4 90 4500 9.00 4.8 43.2
4 48 10 6 90 4500 9.00 4.8 43.2
4 48 10 10 90 4500 9.00 4.8 43.2
5 52 10 11 90 4500 9.00 5.2 46.8
5 52 10 4 90 4500 9.00 5.2 46.8
5 52 10 3 90 4500 9.00 5.2 46.8
5 52 10 1 90 4500 9.00 5.2 46.8
5 52 10 0 90 4500 9.00 5.2 46.8
5 52 10 2 90 4500 9.00 5.2 46.8
5 52 10 8 90 4500 9.00 5.2 46.8
5 52 10 6 90 4500 9.00 5.2 46.8
5 52 10 5 90 4500 9.00 5.2 46.8
5 52 10 3 90 4500 9.00 5.2 46.8
6 58 12 12 90 4500 9.00 4.83 43.5
6 58 12 11 90 4500 9.00 4.83 43.5
6 58 12 3 90 4500 9.00 4.83 43.5
6 58 12 4 90 4500 9.00 4.83 43.5
6 58 12 2 90 4500 9.00 4.83 43.5
6 58 12 0 90 4500 9.00 4.83 43.5
6 58 12 0 90 4500 9.00 4.83 43.5
6 58 12 1 90 4500 9.00 4.83 43.5
6 58 12 4 90 4500 9.00 4.83 43.5
6 58 12 3 90 4500 9.00 4.83 43.5
6 58 12 2 90 4500 9.00 4.83 43.5
6 58 12 4 90 4500 9.00 4.83 43.5
7 42 8 3 90 4500 9.00 5.25 47.25
7 42 8 7 90 4500 9.00 5.25 47.25
7 42 8 6 90 4500 9.00 5.25 47.25
7 42 8 7 90 4500 9.00 5.25 47.25
7 42 8 8 90 4500 9.00 5.25 47.25
7 42 8 4 90 4500 9.00 5.25 47.25
7 42 8 3 90 4500 9.00 5.25 47.25
7 42 8 2 90 4500 9.00 5.25 47.25
8 66 13 3 90 4500 9.00 5.0769 45.69
8 66 13 6 90 4500 9.00 5.0769 45.69
8 66 13 4 90 4500 9.00 5.0769 45.69
8 66 13 3 90 4500 9.00 5.0769 45.69
8 66 13 2 90 4500 9.00 5.0769 45.69
8 66 13 2 90 4500 9.00 5.0769 45.69
8 66 13 8 90 4500 9.00 5.0769 45.69
8 66 13 4 90 4500 9.00 5.0769 45.69
8 66 13 0 90 4500 9.00 5.0769 45.69
8 66 13 4 90 4500 9.00 5.0769 45.69
8 66 13 5 90 4500 9.00 5.0769 45.69
8 66 13 6 90 4500 9.00 5.0769 45.69
8 66 13 3 90 4500 9.00 5.0769 45.69
9 40 8 6 90 4500 9.00 5 45
9 40 8 4 90 4500 9.00 5 45
9 40 8 7 90 4500 9.00 5 45
9 40 8 3 90 4500 9.00 5 45
9 40 8 9 90 4500 9.00 5 45
9 40 8 1 90 4500 9.00 5 45
9 40 8 4 90 4500 9.00 5 45
9 40 8 5 90 4500 9.00 5 45
10 56 11 6 90 4500 9.00 5.09 45.818
10 56 11 7 90 4500 9.00 5.09 45.818
10 56 11 5 90 4500 9.00 5.09 45.818
10 56 11 10 90 4500 9.00 5.09 45.818
10 56 11 11 90 4500 9.00 5.09 45.818
10 56 11 2 90 4500 9.00 5.09 45.818
10 56 11 1 90 4500 9.00 5.09 45.818
10 56 11 4 90 4500 9.00 5.09 45.818
10 56 11 0 90 4500 9.00 5.09 45.818
10 56 11 5 90 4500 9.00 5.09 45.818
10 56 11 4 90 4500 9.00 5.09 45.818



When I specified the following set up

svyset plant [pweight=pwt], fpc(nplant) vce(linearized) || _n, fpc(M)

The total calculated correctly, as did the SE, but the mean is incorrect (showing the simple mean of the dataset 4.6 not the mean of 4.8 which is correct). This is because (?) the population size is seen as 4698 (the sum of the weights) not 4500 and the total hours/population size is then 4.6.

What should the correct design setup in STATA be?

Thanks for your help.

Susan
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index