XLMiner™ can produce samples from MS-Access databases.
Select XLMiner --> Data Utilities --> Sample from database.
Select the data source and select Connect to a database. You get login forms for Oracle and SQL Server. For MS-Access you get the following.
Click ok after opening the correct database.
The following dialog appears on screen. (For illustration, MS-Access is used as the data source.)
Fill up the dialog as shown above. If you want to select stratified sampling, see below.
The selected database is already displayed. Select the table to be sampled.
Fields in table : XLMiner™ displays the fields in table once the table is selected. By default it selects first table in the database. Select the required fields and they will appear in the list of selected fields.
Specify Primary key : This field should have all unique values and no null values.
Sampling Options :
Sample With replacement : If checked the data is sampled with replacement. The default is sampling without replacement.
Set Seed : The user can enter the sorting seed. The default seed is 12345.
Desired sample size : The user can enter here the sample size as desired. (Note that the actual sample size may vary a little, depending on the further instructions from the user. We will know why as we go ahead.)
Simple random sampling : The data is sorted using the simple random sampling techniques taking into account the other parameters entered earlier.
Stratified random sampling : If this sampling method is to be used XLMiner™ provides a the following options.
Stratum Variable : From the list of variables, the user can decide which to use for stratified random sampling. Note that XLMiner™ allows only those variables which have less than 30 distinct values. As the user selects the variable name XLMiner™ displays the no. of strata that variable contains in a box in front and smallest stratum size in a box in front of the option "Equal from each stratum, #records = smallest stratum size".
Pick records from strata :
Proportionate to stratum size : XLMiner™ detects the proportion of each stratum in the dataset and maintains the same in sampling. Due to this XLMiner™ sometimes has to change the desired sample size (on the higher side) in order to maintain the proportionate stratum size. XLMiner™ then displays the actual sample size in the output along with the desired sample size as shown below.
Equal from each stratum : On specifying the no. of records, XLMiner™ generates sample which has that same number of records from each stratum. In this case the number chosen automatically decides the desired sample size, so the option to enter the desired sample size is not available.
Equal from each stratum, #records = smallest stratum size : XLMiner™ detects the smallest stratum size and generates a sample wherein every stratum has a representation of that size. Again here option for the desired sample size is not required.
XLMiner™ performs the stratified random sampling with or without replacement. If you choose sample without replacement, you can not have the desired sample size greater than the number of records in the dataset, for obvious reasons. While entering the #records in the option "equal from each stratum" do not enter a number which will make the sample size greater than the size of the dataset.
If you choose to sample with replacement, then the no. of records in the dataset does not pose any limit on the no. of records in the sample. XLMiner™ can generate a sample having upto 2000 records.