Announcement

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

  • Fixed Effects Regression without Time variable

    Hi all,

    I have a panel data that consists of multiple flight legs that can happen anytime within the month of January. I am using a grouping by flight legs arriving to a specific airport. For example, all flights arriving to Boston airport will be group 1 and all flight arriving to JFK will be group 2, etc. I basically have around 500 groups. Since flights can be scheduled at any time and multiple flights arriving at the same airport can be scheduled at the same time, then I can have multiple records having the same time variable within the same group. I also have a large range of time during which the flight can arrive. Example:

    Flight /Time/ Group
    LAX - JFK /January 6, 06:00 am/ 1
    BOS - JFK /January 6, 06:00 am/ 1
    BOS - JFK/ January 7, 06:30 am/ 1
    BOS - CLT/January 2, 06:58 am/ 2
    JFK - CLT/ January 8, 07:05 am/ 2
    LGA - CLT /January 8, 07:05 am/ 2


    I am trying to run a fixed-effects regression but since multiple records can have the same time and time itself can have a large range of values, Is it possible to run the regression without time-fixed effects so only having a group-specific fixed effect? Or does the panelist need to have a time variable to run a fixed-effects regression?

    Thank you!
    Last edited by Stephanie Atala; 06 Feb 2020, 12:49.

  • #2
    You definitely do not need a time variable to run a fixed effects regression. Only the panel variable is needed. When you -xtset- your data, specify the panel variable, and don't put anything for the time variable. Stata will be perfectly happy with that. Then you can run your -xtreg, fe- and there won't be any problem

    By not having a time variable, you do lose certain capabilities: you cannot use time-series operators such as lags and leads and differences, and, consequently, you cannot do analyses involving autoregressive structure. But with multiple observations having the same time in a group, lags and leads, etc. aren't definable anyway.

    Comment


    • #3
      Thank you Clyde. I have some additional questions if you are able to help. I have a number of predictors that I want to use in the fixed-effects regression. Most of my predictors are continuous variables but I have one variable that I encoded as Categorical which is basically the size of the departure airport. I have two questions.

      2) I want to run the Hausman test to verify that I should use Fixed Effects instead of Random Effects. Can I run Hausman when I have a categorical Variable among my predictors? Because when I do, I get the following message "the rank of the differenced variance matrix (14) does not equal the number of coefficients being tested (15); be sure this is what you expect, or there may be problems computing the test. Examine the output of your estimators for anything unexpected and possibly consider scaling your variables so that the coefficients are on a similar scale."

      1) Can I run a Spearman correlation for all my variables to check for correlation? (even if some of my variables are continuous and some are categorical?



      Thank you!

      Comment


      • #4
        Stephanie:
        1) if you your categorical variable is a time-invariant predictor, -fe- estimator, as expected, will wipe it out;
        2) the warning message thrown by -hausman- is probably due to singleton(s);
        3) as far as correlation is concerned, I would go -estat vce- after -xtreg-.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X