Dear Forum,
i would like to winsorize my data in order to controll/minimze the influence of outliers. My dataset consists of ROA figures for severaly companies within several industries. The ROA is listed in one variable for all companies and the industry is specified in a industry dummy variable. Given that the ROA is vastly differing between industries i dont want to winsorize directly my whole ROA variable but winsorize within the frame of each industry and use e.g. the 5 and 95% of e.g. Manufacturing for ROAs of companies within Manufacturing. I installed the winsor package and used the code
winsor ROA, p(.05) gen(ROA) if Manufacturing==1
However i get the error message r(198) "option if() not allowed". How could i then apply different Winsorization frames for subsets of variables?
Many thanks in advance!
Related Posts with Winsorizing of subsets
gmm estimation of probit model in the presence of heteroscedasticityDear statalists, I tried to conduct a Monte Carlo simulation to show that under conditional heteros…
Instrumental variables with many missing values in the endogenous regressorHi, I have a data set with 10k observations for Y and an endogenous regressor X with many missing o…
Help with regression of (unbalanced) panel data - xtreg, statsby/regressby generating difference resultsHi Statalist! First of all, thank you for all the help you give on a daily basis! It's been very he…
Logistic Regression with ClusteringHello users, I am new to the forum, but hoped you would be able to settle a small dispute we are ha…
How to in Stata get data from different WRDS library in one batchIt works if I execute in Stata odbc load, exec("select permno, shrcd, date, prc, vol, ret from crsp.…
Subscribe to:
Post Comments (Atom)
0 Response to Winsorizing of subsets
Post a Comment