1
$\begingroup$

Say I have a data set for some past period. Now new data appears and for a given variable in the data and we find that the distributions have shifted (for example with "age" it would be that suddenly there are not nearly as many older people, etc..).

How could I draw a sample from the old data set with respect to that shifted variable so that the distributions would mimick the new data distributions?

$\endgroup$

1 Answer 1

0
$\begingroup$

Let's assume you want a sample of size $N$ where variable $V$ follows its distribution in the new dataset:

  1. Draw $N$ instances from the new dataset. Let $A= [v_1,..,v_N ]$ the list of $N$ values of $V$ corresponding to these instances.
  2. For every distinct value $v \in A$:
    • Select the subset $S$ of instances in the old dataset which have $v$ as a value for $V$,
    • let $\#v$ be the frequency of $v$ in $A$: draw $\#v$ instances from the subset $S$

At the end of this process you have obtained $N$ instance from the old dataset which follow the distribution of $V$ in the new dataset.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.