Hello,
I need to do normal scores transformation (Van der Waerden) but I cannot find the command! Is it doable in stata?
I need to do normal scores transformation (Van der Waerden) but I cannot find the command! Is it doable in stata?
sysuse auto, clear gen byte miss = missing(rep78, price) bysort miss rep78 : egen rank = rank(price) if miss == 0 by miss rep78 : gen pp = rank / ( _N + 1 ) gen normscore = invnormal(pp)
. // create some example data . clear . set seed 123 . set obs 10 obs was 0, now 10 . gen x = rnormal() . . egen ben = std(x) . egen rank = rank(x) . gen pp = rank/( _N + 1 ) . gen maarten = invnormal(pp) . drop rank pp . list +-----------------------------------+ | x ben maarten | |-----------------------------------| 1. | 2.08619 1.56843 1.335178 | 2. | -.3528706 -.6759967 -.6045853 | 3. | .3006571 -.0746197 -.1141853 | 4. | .8069299 .3912531 .3487557 | 5. | .1201693 -.2407048 -.3487557 | |-----------------------------------| 6. | .9289025 .5034924 .6045854 | 7. | 1.670093 1.185537 .9084579 | 8. | -1.552079 -1.779509 -1.335178 | 9. | .5268717 .1335432 .1141853 | 10. | -.7173868 -1.011425 -.9084579 | +-----------------------------------+
Comment