Hi, I want to generate 10000 samples from normal distribution with replacement case and every sample size is 50. What should I do ? -- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676.html Sent from the R help mailing list archive at Nabble.com.
1st. Calm down, this doesn't seem that important. Then you will need to know some base functions. see ?rnorm Doing this 10,000 times and making them of size 50 is no problem. FYI: I don't understand what "with replacement case" means; could you clarify? Jasmin wrote> Hi, > I want to generate 10000 samples from normal distribution with > replacement case and every sample size is 50. What should I do ?-- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676p4650677.html Sent from the R help mailing list archive at Nabble.com.
What do you want to do with the samples after you generate them? What are the parameters for the normal distribution? You left a lot of information out. You can generate 500,000 numbers and then store them in a 10000x50 matrix quite easily. On Sat, Nov 24, 2012 at 5:03 PM, Jasmin <yasemin_deniz89 at hotmail.com> wrote:> Hi, > I want to generate 10000 samples from normal distribution with replacement > case and every sample size is 50. What should I do ? > > > > -- > View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org 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.-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
jholtman wrote> What do you want to do with the samples after you generate them? What > are the parameters for the normal distribution? You left a lot of > information out. You can generate 500,000 numbers and then store them > in a 10000x50 matrix quite easily. > > On Sat, Nov 24, 2012 at 5:03 PM, Jasmin <> yasemin_deniz89@> > wrote: >> Hi, >> I want to generate 10000 samples from normal distribution with >> replacement >> case and every sample size is 50. What should I do ? >> >> >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >>> R-help@> 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. > > > > -- > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > ______________________________________________> R-help@> 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.maybe ... replicate(10000, rnorm(50)) could work for you HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676p4650686.html Sent from the R help mailing list archive at Nabble.com.
I try to use hansen-hurwitz and horvitz-thompson estimator.So I should generate samples which come from normal distribution (mu=50,sigma=3). -- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676p4650690.html Sent from the R help mailing list archive at Nabble.com.
Jasmin wrote> I try to use hansen-hurwitz and horvitz-thompson estimator.So I should > generate samples which come from normal distribution (mu=50,sigma=3).I have taken the liberty of scaling the problem down to something more digestible and have changed lines 5 and 7 in your code nsamples=10 sampsize=5 i=0 y=matrix(rnorm(nsamples*sampsize,50,3),nrow=nsamples) s=matrix(NA,10,5) for(i in 1:10){ s[i,]=sample(y,5,replace=T) } HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676p4650692.html Sent from the R help mailing list archive at Nabble.com.
PLEASE remember: This list has a "no homework" policy. Students should do their own homework. cheers, Rolf Turner On 25/11/12 13:18, Pete Brecknock wrote:> Jasmin wrote >> I try to use hansen-hurwitz and horvitz-thompson estimator.So I should >> generate samples which come from normal distribution (mu=50,sigma=3). > I have taken the liberty of scaling the problem down to something more > digestible and have changed lines 5 and 7 in your code > > nsamples=10 > sampsize=5 > i=0 > y=matrix(rnorm(nsamples*sampsize,50,3),nrow=nsamples) > s=matrix(NA,10,5) > for(i in 1:10){ > s[i,]=sample(y,5,replace=T) > }