Announcement

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

  • Combing Quaterly and Daily Data for Panel Data Regression

    Hello,

    I'm using a dataset that has data divided across quarters and days of a week.
    That is, temperature and hours worked across a week, every quarter.

    Right now, my data looks like this:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double pid byte day str2 visit byte hday float tday
    11122110103 1 "V1" 10 31.666666
    11122110103 2 "V1" 10  31.93333
    11122110103 3 "V1" 10 32.361538
    11122110103 4 "V1" 10      33.4
    11122110103 5 "V1" 10 33.816666
    11122110103 6 "V1" 10     33.75
    11122110103 7 "V1" 10 32.416668
    11122120201 1 "V1"  8 31.666666
    11122120201 2 "V1"  8  31.93333
    11122120201 3 "V1"  8 32.361538
    11122120201 4 "V1"  8      33.4
    11122120201 5 "V1"  8 33.816666
    11122120201 6 "V1"  8     33.75
    11122120201 7 "V1"  8 32.416668
    11122130102 1 "V1"  8 31.666666
    11122130102 2 "V1"  8  31.93333
    11122130102 3 "V1"  8 32.361538
    11122130102 4 "V1"  8      33.4
    11122130102 5 "V1"  8 33.816666
    11122130102 6 "V1"  8     33.75
    11122130102 7 "V1"  8 32.416668
    11122210103 1 "V1" 10 31.666666
    11122210103 2 "V1" 10  31.93333
    11122210103 3 "V1" 10 32.361538
    11122210103 4 "V1" 10      33.4
    11122210103 5 "V1" 10 33.816666
    11122210103 6 "V1" 10     33.75
    11122210103 7 "V1" 10 32.416668
    11122230101 1 "V1"  9 31.666666
    11122230101 2 "V1"  9  31.93333
    11122230101 3 "V1"  9 32.361538
    11122230101 4 "V1"  9      33.4
    11122230101 5 "V1"  9 33.816666
    11122230101 6 "V1"  9     33.75
    11122230101 7 "V1"  9 32.416668
    11164130102 1 "V1"  8 31.666666
    11164130102 2 "V1"  8  31.93333
    11164130102 3 "V1"  8 32.361538
    end

    This shows just for V1 but it goes on till V4
    Additionally, the pid's look the same but are unique across a week as they track one person's working hours.

    I want to run a panel data regression and for this, I need to combine the quarter and the day to get a single time variable to that I can xtset the data and run the regression (hday on tday)

    How would I go about combining the two?

    Additionally, this is only for one year. I want to do this for 4 years and then combine the years, the quarters and the dow to make one time variable. How would I go about this?

    Thank you.



  • #2
    egen group

    Comment

    Working...
    X