Hi
For each variable of the many variables I have, I would do the following for winsorizing:
However, because I have many variables, I would do the following command:
However, results are different for the two methods used. I do not know why. I would like to get the same results as the first method but using the second command. Thanks in advance.
For each variable of the many variables I have, I would do the following for winsorizing:
Code:
replace variable =r(p1) if variable <r(p1) replace variable =r(p99) if variable >r(p99) & variable !=.
However, because I have many variables, I would do the following command:
Code:
foreach v of varlist I_* C_CG_* C_ED_* { replace ‘v’ =r(p1) if ‘v’ <r(p1) } foreach v of varlist I_* C_CG_* C_ED_* { replace ‘v’ =r(p99) if ‘v’ >r(p99) & ‘v’ !=. }
However, results are different for the two methods used. I do not know why. I would like to get the same results as the first method but using the second command. Thanks in advance.
Comment