Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Random and Exogenous Variation in the Model

DataSource

You have another opportunity to customize the source of variation with the DataSource selection shown in Figure 6.1. With this choice, you can select a SAS data set and a numeric variable. Whenever a sample is needed, 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 in Figure 6.7.

cpdataso.gif (5939 bytes)

Figure 6.7: The DataSource Control

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;

Then, the selections highlighted in Figure 6.7 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 will rewind the data set to the beginning and reuse 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.