To select a random sample from dataset is more complicated than selecting 10 entities from a dataset consisting of 500 entities. But we have to keep in mind that it’s not quite as straightforward as it appears to us. To eliminate bias and other undesirable possible repercussions, we use random sampling. Before starting to list these methods, keep in mind that a random sample/data/dataset is some data that is randomly chosen from a matrix of a dataset.
![genodive sample data matrix genodive sample data matrix](https://cdn.sketchbubble.com/pub/media/catalog/product/optimized/e/e/eea24e6e0164a63246a0baba81c6a884f909b7ae45f5d1af424ceae10a576fb0/hr-plan-development-mc-slide2.png)
We can perform this task using more than one random sampling method. We want to select a random sample containing 50 entities from our matrix. Let us assume that we have a matrix containing our dataset with 50,000 rows.
#GENODIVE SAMPLE DATA MATRIX HOW TO#
To clear your concepts and give you a full insight on how to obtain random samples, we will explain the functions like Randn, randsample, datasample by giving examples of codes to extract random samples from your dataset with replacement as well as without replacement/substitution along with snippets showing how your output will look like.
![genodive sample data matrix genodive sample data matrix](https://image.slidesharecdn.com/2dbarcode-datamatrix-pub-110206085800-phpapp01/95/the-2d-code-data-matrix-5-728.jpg)
![genodive sample data matrix genodive sample data matrix](http://www.mobiliodevelopment.com/wp-content/uploads/2012/03/header1.png)
We will look at different methods to select random samples from any dataset, array, or matrix using different commands of MATLAB. Extract Random Sample Subsets of a Column From a Dataset Matrix Using datasample in MATLAB.Extract Random Samples Using the datasample Function in MATLAB.Extract Random Samples Using the randsample Function in MATLAB.