> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of xin wei > Sent: Monday, July 26, 2010 11:36 AM > To: r-help@r-project.org > Subject: [R] how to generate a random data from a empirical > distribition > > > hi, this is more a statistical question than a R question. but I do > want to > know how to implement this in R. > I have 10,000 data points. Is there any way to generate a empirical > probablity distribution from it (the problem is that I do not know what > exactly this distribution follows, normal, beta?). My ultimate goal is > to > generate addition 20,000 data point from this empirical distribution > created > from the existing 10,000 data points. > thank you all in advance. >
Without knowing more than what you have stated in your email, I can only suggest that you look at ?sample You may be able to do something as simple as newdata <- olddata[sample(1:10000,size=20000,replace=TRUE)] If you need more help, you need to tell us more about your data and what you are trying to do. Hope this is helpful, Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 ______________________________________________ R-help@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.