首页 > > 详细

调试R、R编程辅导、辅导All relevant work、Data Collection编程辅导、辅导留学生Data Collection设计、

All relevant work must be shown for credit.
Note 1: The completed assessments must be HANDED IN during the class. You
should have your student card ar the time you submit the assignment. Please
DO NOT EMAIL your assignments. I DO NOT accept assignments through
email. Any assignments sent though email will be deleted.
Note2: In any question, if you are using R, all R codes and R outputs must
be included in your answers. You should assume that the reader is not familiar
with R outputs and so explain all your ndings, quoting necessary values form
your outputs.
Note 3:Whenever you are using an R command for generating random numbers,
set seed to 123. This can be done by simply adding the command set.seed(123)
before the your R command for generating the random number.
Note 4: Please note that academic integrity is fundamental to learning and
scholarship. You may discuss questions with other students. However, the work
you submit should be your own. If I feel suspicious of any assignment (e.g. if
your work doesn’t appear to be consistent with what we have discussed in class),
I will not mark the assignment. Instead, I will ask you to present your work in
my o ce and your grade will be assigned based on your presentation.
Total points for this assignment: 51
1. (12 points) A psychologist wants to estimate the average household income in a small
city. No list of households was available and so decided to use one stage cluster sampling.
The city consisted of 100 blocks and the psychologist considered these blocks as clusters.
She selected a SRSWOR of ten clusters and interviewed every household within each
cluster selected. The data on household income (in dollars) are given below.
Cluster Income
1 5579 5578 5588 5577 5582 5584 5574
2 5438 5414 5410 5423 5420 5408 5417 5407
3 5551 5563 5549 5524 5544 5545 5534 5545 5551 5551 5534
4 5381 5361 5368
5 5697 5693 5675 5686 5692
6 5388 5385 5392
7 5330 5341 5350 5343 5347 5356 5355 5360 5369
8 5510 5526 5528 5508 5522 5531 5518 5540
9 5556 5570 5564 5547
10 5451 5446 5444 5449
Use the data to estimate the average household income in the city, its standard error of
estimation and an approximate 95% con dence interval. Make sure that you check for
the appropriateness of the methods you are using.
2. In class we discussed systematic sampling. We noticed that it leads to di culties when
n is not an integer. We discussed some ways to deal with this situation. Another thingwe can do is circular systematic sampling. This scheme can be used in both the cases,
where Nn is an integer of not. The method regards the N units as arranged round a
circle, and consists in choosing a random start from 1 to N instead of from 1 to k, where
k is the integer closest to Nn (i.e. normal rounding o ). The unit corresponding to this
random start is the rst unit included in the sample. Thereafter, every kth unit, from
those assumed arranged round the circle, is selected until a sample of n units is chosen.
More concisely, if r is a random start, 1 r N, then the units corresponding to the
serial numbers:
where sr is the circular systematic sample with starting point r and y(sr) is its sample
mean.
As in linear systematic (i.e. usual systematic sampling that we discussed in class),
an unbiased estimator of the variance of the sample mean is not available from a sys-
tematic sample with one random start. Some biased estimators of variance are possible
on the basis of a systematic sample. One which takes into account successive di erences
of the sample values is:
The data le csys.txt contains data on annual income of 5000 households. You may as-
sume that they are arranged in some order (eg. sequentially located on a long road). The
rst column contains the household numbers and the second column contains income.
(a) (5 points) Use R to select a circular systematic sample of n = 47 households.
Systematic sampling requires only one random number for the rst item. Take that
random number to be 1438. Print the household numbers of the households selected
into the sample.
Question 2 continues on the next page. . .
Page 3 of 4
(b) (3 points) Print the annual incomes of the 47 households selected in part (a) above.
(c) (3 points) Calculate the average income of the systematic sample selected in part
(a).
(d) (5 points) Use the formula given in equation 2 above to estimate the variance of
the mean of the circular systematic sample selected in part (a) above.
3. The daily wages (in dollars) paid by an employer to a population of 9 employees are
given below:
Name Wages
1 64
2 62
3 51
4 71
5 67
6 64
7 61
8 58
9 55
We want to select a sample of size 3 from this population, using the following sampling
design and estimate the total wages paid by this employer.
Sample Probability
s1 1 2 3 0.06
s2 1 6 8 0.06
s3 4 5 6 0.06
s4 2 4 9 0.06
s5 7 8 9 0.08
s6 3 5 7 0.08
s7 1 4 7 0.08
s8 1 5 9 0.08
s9 2 5 8 0.11
s10 2 6 7 0.11
s11 3 6 9 0.11
s12 3 4 8 0.11
I selected a sample using this design. The sample selected is S11 = (3;6;9).
(a) (5 points) Calculate the Horvitz-Thompson estimator of the total wages.
(b) (5 points) Calculate the standard error of your estimate using Sen, Yates Grundy
method.
(c) (5 points) Calculate the Horvitz-Thompson estimator of the total wages using every
possible sample (i.e. samples S1;:::;S12).
Question 3 continues on the next page. . .
Page 4 of 4
(d) (5 points) Use the values calculated in part (c) above to calculate E(^yHT).
(e) (3 points) Since we have the data for th entire population, we can calculate the
population total. Calculate population total and comment on your results. (Hint:
Compare your answer with E(^yHT).)

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!