Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Winsorzing all variables of interest & generating new variables ignoring missing

    Hello all,


    No.1
    I am very new in using STATA. I need to winsorize variables (lets say Var1...Var10) of panel data (2001-2010) at 1st and 99th percentile & how can I plot the graph before and after winsorizing?

    No.2
    I have two variables ch and che. i want to create a new variable (gen chnew= ch+che ) but it results in some missing values because ch has some missing obs. What should be the command for stata so that it should not ignore the missing (zero) and thus result in the complete obs for the new variable, chnew?

    Many thanks.

    p.s. Im using STATA 15.

  • #2
    1. use -search winsor2- to find and download this user-written command; when you use it, do NOT use the "replace" option; you will now have both the original and winsorized variables in your file; it is not clear what kind of graph, or what kind of comparison you want; one simple option is just to plot them against each other use a scatter plot; see
    Code:
    h scatter
    for more; if this is not what you want, please clarify

    2. use the -egen- command with the "rowtotal" option; see
    Code:
    help egen

    Comment

    Working...
    X