Dear All,
I am working with firm level data. I want to generate a variable lsales = ln(sales) and want to replace the values in lsales as missing if the values in the variable lsales are higher than mean+3*standard deviation. While doing so, I want the summary stat of lsales by grouping state and sector and if the observation of lsales is more than 1000 in the individual group (state-sector) then find the outlier and replace it as missing. If the number of observation is less than 1000 in any of the group (state-sector) then I want to group lsales by the state only and find out the summary stat and replace the outlier with missing values. Please suggest to me how should I code this, as I am unable to visualise the loop for the condition.
Thanks
Prakash
Related Posts with Generating variable and replacing the outlier as missing based on grouping and condition
Why stricter the condition, the higher probability?I am using joint null test if all averaging effect of these variables (dkt_4 dkt_3 dkt_2 dkt_1) is 0…
Creating Calendar-Time Portfolios Following EventsDear all, I am currently working on a study on the effect of televised stock recommendations in the…
Estimates of Marginal Effects after GMMHello Experts and Researchers ! Could anyone suggest me the code and command on how to estimate marg…
permute with reghdfeDear All, Please, I am using reghdfe absorbing a(counties years). I want to 'scramble' years, assign…
ivtobit first stage R2Hi stata users, Currently, I am estimating an econometric model with IVTOBIT in order to address so…
Subscribe to:
Post Comments (Atom)
0 Response to Generating variable and replacing the outlier as missing based on grouping and condition
Post a Comment