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
Parallel Trends DIDDear StataList Users, I am using a Difference in Difference Model but I am facing a challenge in es…
mean regression vs. regression toward the meanDear All, I just have a few dumb questions. Hopefully, someone here will help me understand econome…
How to graph the interaction effects of two dummy variables?Hi, I am trying to graph an interaction between two dummy variables (s and p) to see if the interact…
meta analysis of proportionsI am conducting a meta analysis of prevalence studies in Stata. Stata displays proportions in table …
See the duplicates observations in data editor screenHello everyone, I wish to see the duplicates observation in data editor screen, what command I have…
Subscribe to:
Post Comments (Atom)
0 Response to Generating variable and replacing the outlier as missing based on grouping and condition
Post a Comment