Announcement

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

  • Combine like variables whose values are percentages

    I have a large dataset with over 2000 variables and would like to combine like variables, but the values within the variables are percentages. For example pcip1 pcip2 pcip3 etc all the way to 54 are percentages.These variables are by institution. I want to combine them into one variable if kinda like a dummy variable if that is possible.

  • #2
    Your question is unclear. First, there are many ways to combine variables. You can sum them, average them, multiply them, etc. Second, you want the result to be an indicator (or as you call it, dummy). This will represent a condition, or set of conditions, which you do not define. Assume that you have the dataset below with 2 institutions and 3 variables, similar to what you describe above. How do you want the result to look like?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(institution pcip1 pcip2 pcip3)
    1 44 47  5
    1 34 50 95
    1 17 15 63
    1  3 96 91
    1 44 88 17
    2  9 87 62
    2 41 58 98
    2 71  8 32
    2 26 43 21
    2 74 92 95
    end

    Comment

    Working...
    X