Announcement

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

  • A fixed effects question

    Hi,

    I'm running a simple hedonic regression using a property dataset, where:

    regress ln_price ln_bedrooms ln_bathrooms b1.Locality_clean i.datum if listing_observed == 1
    The coefficients all follow the expected signs, and I'm quite happy with the results. However, I have a small issue with the benchmark category of the Locality_clean variable. I chose to go with b1.Locality_clean, and the output from the regression is saying:

    Locality_clean |
    . | 0 (empty)
    L1 | .0805942 .0605585 1.33 0.183 -.0381022 .1992907
    L2 | -.1682424 .1626097 -1.03 0.301 -.4869621 .1504773
    L3 | -.4344224 .4724776 -0.92 0.358 -1.360492 .4916471

    Which is strange, given Locality_clean has no . values. Locality is a "long" variable, generated after encoding a string variable named "Locality". If I go with b2.Locality_clean, the "." line disappears (and L1 becomes the base category and obviously disappears too).

    Has anyone ever encountered this issue? It's bugging me a bit...I'm guessing I'm doing something wrong, but I do not know what!

    Thanks a lot!

    Ben.

  • #2
    It looks like your original string variable has values of "." in it, which becomes the first encoded value,* and when you restrict your estimation sample as you did with observed listings, then there are no observations with "." in the estimation sample. You should have seen a warning message like note: 1b.locality_clean identifies no observations in the sample.

    *You can verify this with
    Code:
    label list <name of your set of value labels>

    Comment


    • #3
      First of all, thanks for your reply!

      That's the strange thing. I had expressly removed all the bad/missing observations for that variable in the STATA code. But, just as you suggested, the label list kept insisting there were "." as well as localities which I had dropped in the list.

      Strangely enough, I then copied the string version of the original (un-encoded) variable into another string variable, encoded it again, and all the missing/wrong labels weren't there.

      Thanks for your help, managed to focus my attention to what was going on behind the codes.

      Comment

      Working...
      X