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
How to plot an interaction term in multinomial logistic regression model ?Dear statalists, Hope this post finds you well. I have tried to plot a graph with an interaction …
Random effect model - controlling for timeHy folks, i have the following panel data: ID Birthyear Year of Assessment Fahter played footba…
Panel graph with country names attachedHi all, I'm using panel data on public debt from 1980 to 2015. What I would like to do is a xtline …
Membership functions and fuzzy sets in StataHi, I have a data set on which I want to make Qualitative Comparative Analysis using fuzzy logic. Bu…
Need to Highlight specific points on scatter plot, trying to create new variableHello, beginner to STATA and coding in general. I have a dataset with countries. I created a new var…
Subscribe to:
Post Comments (Atom)
0 Response to Generating variable and replacing the outlier as missing based on grouping and condition
Post a Comment