<< samplef Sampling Data with Missing Values >>

Scilab Help >> Statistics > Sampling > samwr

samwr

Sampling without replacement

Syntax

s = samwr(sizam, numsamp, X)

Arguments

sizam

integer. Size of a sample. It must be lower than or equal to the size of X.

numsamp

integer. Number of samples to be extracted.

X

column vector. It contains the population.

s

matrix of size sizsam * numsamp. It contains numsamp random samples (the columns) each of sizam extractions without replacement from X.

Description

Gives samples without replacement from a column vector.

Random number generator

samwr is based on grand for generating the random samples. Use grand("setsd", seed) to change the seed for samwr.

seed = getdate("s");
grand("setsd", seed); //sets the seed to current date

seed = 0;
grand("setsd", seed); //sets the seed to default value

Examples

a = [0.33 1.24 2.1 1.03]
s = samwr(4, 12, a)

See also


Report an issue
<< samplef Sampling Data with Missing Values >>