Re: [R] Is it the PPS samples i needed in R?

2007-01-16 Thread Thomas Lumley
On Fri, 12 Jan 2007, zhijie zhang wrote:

 Dear friends,
  I want to do a unequal probability sampling, that is, Probability
 Proportionate to size, Is it right for the following programs?
 Say my original dataset is:

 ID  Population
 1 100
 2 200
 3 300
 IF the population is large ,then the corresponding ID has the large
 Probability to be selected.

 sample(A$ID, size=2, replace = FALSE, prob = A$population)
 #suppose the dataset name is A.
 Is it the PPS samples  i needed ?

No, this does not give PPS samples for size1.  The pps and sampling 
packages have code for PPS samples.

-thomas

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Is it the PPS samples i needed in R?

2007-01-12 Thread zhijie zhang
Dear friends,
  I want to do a unequal probability sampling, that is, Probability
Proportionate to size, Is it right for the following programs?
Say my original dataset is:

 ID  Population
 1 100
 2 200
 3 300
 IF the population is large ,then the corresponding ID has the large
Probability to be selected.

sample(A$ID, size=2, replace = FALSE, prob = A$population)
#suppose the dataset name is A.
Is it the PPS samples  i needed ?
 Any suggestions are greatly welcome.

-- 
With Kind Regards,

oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/
:
[***]
Zhi Jie,Zhang ,PHD
Tel:86-21-54237149   [EMAIL PROTECTED]
Dept. of Epidemiology,school of public health,Fudan University
Address:No. 138 Yi Xue Yuan Road,Shanghai,China
Postcode:200032
[***]
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/
:

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.