Announcement

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

  • Help Needed for Beginner Stata User (Simple)

    Hello friends. I am using Stata for the first time for an economics course and I am having trouble with something that should be very simple.

    Basically, I have a dataset in which the variables of interest are: Year, Minimum Wage, and Jurisdiction
    With this dataset, I am to create a graph plotting the minimum wages of each province over the years.
    (x-axis should be the year, y-axis should be minimum wage, with various lines corresponding to each province)
    The problem is that for each year and jurisdiction, I have multiple observations in the same year which gives me the identical minimum wages.
    (I have attached an image to show what I mean by this.)
    I cannot plot them this way because I have more than one minimum wage variable for each year.
    How can I make it so that I only have one minimum wage for each year? For example, in Alberta, in 1977, I should only have one minimum wage observation of $3.

    This is my dilemma.
    Any help would be greatly and kindly appreciated. Thank you.


    Attached Files

  • #2
    Uhhhhhhhhhhhhhhhhhhh if it's me doing this, assuming the minimum wages are all literally the same in each group, I would do something like

    Code:
    collapse (mean) mimim, by(jurisdiction year)
    
    xtset unitID year, y
    
    xtline mimim

    So I can better help you, use the dataex commandso I can work with the same data you're working with. gaurav manchanda

    Comment


    • #3
      Jared Greathouse. You brilliant man, your first line of code has done exactly what I desired. Thank you so much for your help. May you achieve everything you wish for and more in this life.

      Comment

      Working...
      X