Announcement

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

  • Why are my units of observation collinear?

    Hi,

    I am not sure if I am missing something. I am trying to understand the variation in recycling rates by income, population density, household size and method and frequencies of collection dummy variables. I have coded the names of all my local authorities with a number and am performing the following regression, I have prepared my data for panel using xtset generating qdate. I would appreciate if someone could spot where I am going wrong? Thanks in advance!

    xtreg recycling loginc logpopden loghhsize md11 md12 md13 md14 md15 md16 md17 md18 md19 md20 md21 md22 md23 md24 md25 md26 md27 md28 md29 md291 wasteavg dryavg i.qdate i.acode, fe vce(cluster acode)

    Below is a sample of my data too.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str43 name str9 code float(qdate recycling loginc logpopden loghhsize) long(md11 md12 md13 md14 md15 md16 md17 md18 md19 md20 md21 md22 md23 md24 md25 md26 md27 md28 md29 md291) float(wasteavg dryavg)
    "Adur District Council"        "E07000223" 208   30.4213 9.845911   2.663471 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 214  24.05913 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 218  23.56739 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 225 21.361525  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 224  24.94314  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 211  27.44496 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 226 22.360233  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 227  24.90493  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 223 24.494173  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 212  26.41701 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 219    22.308 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 222  23.10587  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 215 25.538834 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 217 21.606844 9.899881   2.668824 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 209   26.3318 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 220  26.12993  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 216 24.828016 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 221 22.491955  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 213 23.614706 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Adur District Council"        "E07000223" 210   24.1123 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 221 17.996565 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 218 18.424616 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 217  20.05145 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 220  21.38195 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 212  27.60073 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 208 23.517796 9.676775  -.3202052 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 227 18.202848 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 214 20.948324 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 216  25.93494 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 210  24.81793 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 219    21.074 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 225  18.68408 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 215  23.11809 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 224 20.904785 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 211 28.645617 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 222 18.247135 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 223   19.8872 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 226 18.956331 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 209  24.62567 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
    "Allerdale Borough Council"    "E07000026" 213 16.717325 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
    "Amber Valley Borough Council" "E07000032" 222  21.58448 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 220 25.957586 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 208   24.2399 9.700024  1.5214807 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 213 22.769114 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 210  21.12068 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 212 30.218664 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 227  23.80245 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
    "Amber Valley Borough Council" "E07000032" 215 24.416813 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 209  21.51657 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 226  21.62769 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
    "Amber Valley Borough Council" "E07000032" 223 24.448854 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 224 26.440403 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
    "Amber Valley Borough Council" "E07000032" 216 27.421017 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 225 21.258547 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
    "Amber Valley Borough Council" "E07000032" 211  24.30441 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 221 22.054287 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 219    24.295 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 214 21.622726 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 218 22.114494 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Amber Valley Borough Council" "E07000032" 217 22.193165 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
    "Arun District Council"        "E07000224" 215  24.77146 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 218 23.992714 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 208   29.3299 9.820486  1.9059806 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 220  27.32221 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 227  26.14676 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 226 25.077284 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 219    25.443 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 209  25.95244 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 210    24.823 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 223 26.376215 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 222 24.842827 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 224 27.472195 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 211  25.98951 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 212 28.331505 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 225 24.137283 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Arun District Council"        "E07000224" 214  24.52534 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 216  25.96568 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 217 23.324226 9.865993   1.911171 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 213  25.00714 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
    "Arun District Council"        "E07000224" 221 24.184074 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
    "Ashfield District Council"    "E07000170" 217 20.540184 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 215  22.89439 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 224  23.52797 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 221  19.44989 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 212  29.11677 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 225   19.9589 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 210 22.973764 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 220 27.286486 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 211  26.85626 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 214   21.4516 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 219    23.144 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 226  17.68261 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 223 23.239914 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 216  27.02235 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 227  25.05528 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 218 20.727064 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 208 28.916216 9.593151  2.3737888 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 222  19.99171 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 213  23.44577 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    "Ashfield District Council"    "E07000170" 209 23.429956 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
    end
    format %tq qdate

  • #2
    The code you show uses a variable that is non-existent in your data, acode. That may or may not have anything to do with colinearity. But it prevents anyone from even working with your code and data to figure it out.

    Please repost with code and data that are consistent with each other and can be used together.

    That said, you have, on the one hand, -xtset- your data with qdate as the panel variable (which, by itself, is odd) and then you have run -xtreg, fe- and also included i.qdate among your variables. With qdate as your panel variable and -xtreg, fe-, qdate fixed effects are automatically included in that regression. So when you also list them explicitly as covariates, you are actually specifying them twice. So they are colinear with their copies, because they are actually equal to their copies. Just drop i.qdate from the list of variables in -xtreg, fe-, as they are automatically included by the -fe- option.

    Comment


    • #3
      Sorry that was a mistake I should have exported 'acode' not 'code'.
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str43 name float(acode qdate recycling loginc logpopden loghhsize) long(md11 md12 md13 md14 md15 md16 md17 md18 md19 md20 md21 md22 md23 md24 md25 md26 md27 md28 md29 md291) float(wasteavg dryavg)
      "Adur District Council"        7000223 208   30.4213 9.845911   2.663471 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 214  24.05913 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 218  23.56739 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 225 21.361525  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 224  24.94314  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 211  27.44496 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 226 22.360233  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 227  24.90493  9.97711  2.6927335 .8712934 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 223 24.494173  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 212  26.41701 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 219    22.308 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 222  23.10587  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 215 25.538834 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 217 21.606844 9.899881   2.668824 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 209   26.3318 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 220  26.12993  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 216 24.828016 9.899881   2.678072 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 221 22.491955  9.97376  2.6887314 .8671005 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 213 23.614706 9.886138   2.668824 .8628899 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Adur District Council"        7000223 210   24.1123 9.845911    2.65858 .8586616 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0  0 1
      "Allerdale Borough Council"    7000026 221 17.996565 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 218 18.424616 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 217  20.05145 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 220  21.38195 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 212  27.60073 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 208 23.517796 9.676775  -.3202052 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 227 18.202848 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 214 20.948324 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 216  25.93494 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 210  24.81793 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 219    21.074 9.709964  -.2984061 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 225  18.68408 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 215  23.11809 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 224 20.904785 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 211 28.645617 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 222 18.247135 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 223   19.8872 9.758347 -.29571423 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 226 18.956331 9.771498 -.29437107 .8712934 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 209  24.62567 9.676775 -.29705927 .8586616 1 1 0 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0  0 1
      "Allerdale Borough Council"    7000026 213 16.717325 9.691964  -.2984061 .8628899 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0  0 1
      "Amber Valley Borough Council" 7000032 222  21.58448 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 220 25.957586 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 208   24.2399 9.700024  1.5214807 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
      "Amber Valley Borough Council" 7000032 213 22.769114 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 210  21.12068 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
      "Amber Valley Borough Council" 7000032 212 30.218664 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 227  23.80245 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
      "Amber Valley Borough Council" 7000032 215 24.416813 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 209  21.51657 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
      "Amber Valley Borough Council" 7000032 226  21.62769 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
      "Amber Valley Borough Council" 7000032 223 24.448854 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 224 26.440403 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
      "Amber Valley Borough Council" 7000032 216 27.421017 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 225 21.258547 9.838789  1.5415872 .8712934 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 .8 1
      "Amber Valley Borough Council" 7000032 211  24.30441 9.700024  1.5288783 .8586616 1 1 0 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0  1 1
      "Amber Valley Borough Council" 7000032 221 22.054287 9.819834  1.5407307 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 219    24.295 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 214 21.622726 9.740204   1.531044 .8628899 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 218 22.114494 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Amber Valley Borough Council" 7000032 217 22.193165 9.749112  1.5370823 .8671005 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0  1 1
      "Arun District Council"        7000224 215  24.77146 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 218 23.992714 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 208   29.3299 9.820486  1.9059806 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 220  27.32221 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 227  26.14676 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 226 25.077284 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 219    25.443 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 209  25.95244 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 210    24.823 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 223 26.376215 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 222 24.842827 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 224 27.472195 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 211  25.98951 9.820486   1.900614 .8586616 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 212 28.331505 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 225 24.137283 9.939385   1.939461 .8712934 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Arun District Council"        7000224 214  24.52534 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 216  25.96568 9.865993  1.9205923 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 217 23.324226 9.865993   1.911171 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 213  25.00714 9.860788   1.911171 .8628899 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0  0 1
      "Arun District Council"        7000224 221 24.184074 9.936874  1.9309415 .8671005 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0  0 .
      "Ashfield District Council"    7000170 217 20.540184 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 215  22.89439 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 224  23.52797 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 221  19.44989 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 212  29.11677 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 225   19.9589 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 210 22.973764 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 220 27.286486 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 211  26.85626 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 214   21.4516 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 219    23.144 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 226  17.68261 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 223 23.239914 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 216  27.02235 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 227  25.05528 9.705341  2.4285126 .8712934 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 218 20.727064 9.641084  2.4119775 .8671005 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 208 28.916216 9.593151  2.3737888 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 222  19.99171 9.701432  2.4198346 .8671005 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 213  23.44577 9.608781   2.400256 .8628899 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      "Ashfield District Council"    7000170 209 23.429956 9.593151   2.394982 .8586616 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0  1 1
      end
      format %tq qdate
      How is this? :

      xtreg recycling loginc logpopden loghhsize md11 md12 md13 md14 md15 md16 md17 md18 md19 md20 md21 md22 md23 md24 md25 md26 md27 md28 md29 md291 wasteavg dryavg i.acode, fe vce(cluster acode)

      Comment


      • #4
        Well, that doesn't run because the panel variable qdate is not nested within your clustering variable acode--so that's not legal.

        Looking more carefully at your data, for which thanks, it appears that the variable acode is just a numerical alias for the variable name. I also note that you include i.acode in your variable list. So perhaps what you really mean to do is use acode as the panel variable, and qdate as the time? Then you need to drop i.acode from the variable list (because it is now the panel variable) and put i.qdate back in (assuming you want time fixed effects). So this works, if it is what you want to do:

        Code:
        xtset acode
        xtreg recycling loginc logpopden loghhsize md11 md12 md13 md14 md15 ///
            md16 md17 md18 md19 md20 md21 md22 md23 md24 md25 md26 ///
            md27 md28 md29 md291 wasteavg dryavg i.qdate, fe vce(cluster acode)

        Comment


        • #5
          Thank you. I want to run the regression with Xit where i is the acode (local authority) and the t is the time period(qdate). I want local authority fixed effects and time fixed effects. Is your equation above appropriate?

          Comment


          • #6
            Yes.

            Comment

            Working...
            X