Spreadsheet.SubsetSystematicRandomSamplingEx
This property creates a new spreadsheet containing the specified subset of the current spreadsheet using selection conditions and Systematic Random Sampling.
| Syntax | Parameters | Return Value |
|---|---|---|
ReadOnly Property Spreadsheet.SubsetSystematicRandomSamplingEx( _
Variables As Variant, _
selectionIncludeExpression As String, _
selectionIncludeList As String, _
selectionExcludeExpression As String, _
selectionExcludeList As String, _
sampleSize As Integer) As Spreadsheet
|
Type: Variant Type: String Type: String Type: String Type: String Type: Integer |
Spreadsheet |
SVB Example
Creating a (systematic) random sample (advanced):
Option Base 1
Sub Main
Dim spr As Spreadsheet
'assigns the active spreadsheet to the object spr
Set spr = ActiveDataSet
Dim outputspr As Spreadsheet
'creates a systematic random subset using all variables and a selection include expression
'The first parameter is the number of variables to include in the subset
'(Note that "*" = all variables), "1-5" would be used to include variables 1-5
'the second, third, fourth, and fifth parameters are the selection condition strings
'the sixth parameter is the systematic random sampling parameter. In this example
'five was used, as a result, one case will be randomly selected from the first 5 cases and then
'finish obtaining the subset by selecting each fifth case in the spreadsheet after the
'originally selected case.
Set outputspr = spr.SubsetSystematicRandomSamplingEx("*","v1='MALE'","","","",5)
'display the resulting subset
outputspr.Visible = True
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
