Announcement

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

  • Finding Percentage Occurrence of a Dummy Variable Given the Values of Several Other Variables

    Hello,

    I apologize in advance for any beginner's mistakes, as this is my first post. I'm working with panel data of five variables: Year, SenateHouse, State, GeneralElectionStatus, and IncumbentChallengerStatus. Each observation is an individual political campaign. SenateHouse is a dummy variable for whether the campaign is for the Senate or the House of Representatives, State is the American state of the campaign (encoded), GeneralElectionStatus is a dummy for if the campaign was victorious or not, and IncumbentChallengerStatus is a dummy for if the campaign was that of an incumbent or a challenger. My goal is to find the percentage of political campaigns within each year, state, and chamber of congress that were those of incumbents. An incumbent ratio of sorts. I've been looking into using the "contract" command, but hadn't been able to figure out how to get the percentage value within the categories of the other variables. Any assistance that you may be able to provide is much appreciated.
    Last edited by Seth Carter; 20 Jul 2019, 12:02.

  • #2
    if the variable you are interested in is coded 0/1, then the mean (multiplied by 100) is the percentage;

    please read the FAQ which has great advice on asking questions - yours is particularly hard to follow and, since there is no example data, it is not possible to give actual code advice

    Comment

    Working...
    X