Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Random and Exogenous Variation

DataSource

You have another opportunity to customize the source of variation with the DataSource selection shown in Figure B.1. With this choice, you can select a SAS data set and a numeric variable. Whenever a sample is needed from a DataSource, an observation is read from the data set and the value of the selected variable is used as the sample value. You choose the data set by clicking the  {Parameters}
button, which displays the DataSource Control window shown in Figure B.6.


cpdatasource.gif (43527 bytes)

Figure B.6: The DataSource Control Window

Suppose that you had executed the following DATA step, which sampled 10,000 observations from the mixture distribution with density function

f(x)=.5 f1(x) + .5 f2(x)
where f1(x) is exponential with parameter 1 and f2(x) is uniform.

 data mixture;
    keep sample;
    do i = 1 to 10000;
       if ranuni(123456789) < .5 then
            sample = ranexp(98765432);
       else sample = ranuni(54321678);
       output;
       end;
 run;

Then, the selections highlighted in Figure B.6 would result in the sample being used. Note that the simulation may require more than 10,000 observations of the random variable with this mixture density. In this case, the DataSource rewinds the data set to the beginning and reuses the sample. If this feature is not accounted for, it could result in some unexpected and incorrect estimates of performance measures.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.