Announcement

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

  • Fixed Effects using LSDV with Driscoll-Kraay standard errors

    Hello everyone,

    I am trying to estimate a fixed effects model (with an unbalanced panel data) with Driscoll-Kraay standard errors where I can see the particular effect of my entities. In other words a Fixed Effects using least squares dummy variable model (LSDV) with Driscoll-Kraay standard errors.
    I tried the command:

    xtscc $y $x i.entity i.year, lag(3)

    But is telling me "date is not regularly spaced: there are contemporaneous gap(s) across all subjects in entity".

    In this regard I have two doubts what does this error mean? what do the lags I apply mean? I don't understand the lags very well, since I tried to take up the idea in another question in the forum.

    Thank you very much for your help.

  • #2
    The error is saying what is the problem: your time variable is not regularly spaced.

    Putting the lag option tells the command at which lag to truncate the HAC variance estimate.

    I guess it will give you the same error if you omit the lag(3) option.

    Comment


    • #3
      Joro Kolev ,

      Thank you very much for your prompt response. The problem with my data is that, for each entity, the dates (which are daily observations) start in different months of the year 2011 and end in different months of the year 2018. Still, it can be said that they fall within the same range of years. I guess that is why it tells me that my dates are not regularly spaced? Reading in the forum I saw that a possible solution is to create my own time variable (https://www.statalist.org/forums/for...gularly-spaced ) like this:


      Code:
      egen time = group(date), label
      and then use

      Code:
      xtset entity time
      and run

      Code:
      xtscc $y $x i.entity i.year

      Do you think this correct for my specific problem? If not, do you have any suggestion on how to solve my problem?

      And the lag option is clear now...

      Thanks again in advance!

      Comment


      • #4
        I do not see your data, so I do not know. If you want post a sample of your data using the command -dataex-.

        The -egen- is not likely to work, because it does not know about the ordering in your data.

        Comment


        • #5
          Joro Kolev ok! I am new using this forum so I hope this big data set is not so disturbing. Thank you very much!

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input float(date entity y x1 x2 year)
          18809 1   19.029999 270.81 -2.73 2011
          18812 1        19.1 270.81 -2.73 2011
          18813 1       22.18 270.81 -2.73 2011
          18814 1       20.64 270.81 -2.73 2011
          18815 1       22.04 270.81 -2.73 2011
          18816 1       20.75 270.81 -2.73 2011
          18819 1       20.65 270.81 -2.73 2011
          18820 1       20.33 270.81 -2.73 2011
          18821 1       21.29 270.81 -2.73 2011
          18822 1       21.29 270.81 -2.73 2011
          18823 1       20.51 270.81 -2.73 2011
          18826 1       20.05 270.81 -2.73 2011
          18827 1       20.82 270.81 -2.73 2011
          18828 1       20.82 270.81 -2.73 2011
          18829 1       21.06 270.81 -2.73 2011
          18830 1       21.15 270.81 -2.73 2011
          18833 1       20.84 270.81 -2.73 2011
          18834 1       20.51 270.81 -2.73 2011
          18835 1        19.9 270.81 -2.73 2011
          18836 1        19.9 270.81 -2.73 2011
          18837 1        19.9 270.81 -2.73 2011
          18840 1       20.52 270.81 -2.73 2011
          18841 1       19.43 270.81 -2.73 2011
          18842 1       19.04 270.81 -2.73 2011
          18843 1   18.990002 270.81 -2.73 2011
          18844 1       18.23 270.81 -2.73 2011
          18847 1   17.849998 270.81 -2.73 2011
          18848 1       18.79 270.81 -2.73 2011
          18849 1       19.53 270.81 -2.73 2011
          18850 1       19.76 270.81 -2.73 2011
          18851 1       19.76 270.81 -2.73 2011
          18854 1       19.29 270.81 -2.73 2011
          18855 1   18.849998 270.81 -2.73 2011
          18856 1       20.57 270.81 -2.73 2011
          18857 1       20.06 270.81 -2.73 2011
          18858 1       20.18 270.81 -2.73 2011
          18861 1       20.18 270.81 -2.73 2011
          18862 1       21.92 270.81 -2.73 2011
          18863 1       22.59 270.81 -2.73 2011
          18864 1       21.99 270.81 -2.73 2011
          18865 1       22.02 270.81 -2.73 2011
          18868 1       22.82 270.81 -2.73 2011
          18869 1       23.24 270.81 -2.73 2011
          18870 1       23.76 270.81 -2.73 2011
          18871 1       23.78 270.81 -2.73 2011
          18872 1       23.08 270.81 -2.73 2011
          18875 1       22.86 270.81 -2.73 2011
          18876 1       22.09 270.81 -2.73 2011
          18877 1       22.06 270.81 -2.73 2011
          18878 1       22.35 270.81 -2.73 2011
          18879 1       21.62 270.81 -2.73 2011
          18882 1       21.81 270.81 -2.73 2011
          18883 1       21.89 270.81 -2.73 2011
          18884 1       21.18 270.81 -2.73 2011
          18885 1       21.67 270.81 -2.73 2011
          18886 1       19.93 270.81 -2.73 2011
          18889 1       19.84 270.81 -2.73 2011
          18890 1       20.34 270.81 -2.73 2011
          18891 1       19.97 270.81 -2.73 2011
          18892 1        19.3 270.81 -2.73 2011
          18893 1       20.59 270.81 -2.73 2011
          18896 1       18.96 270.81 -2.73 2011
          18897 1   19.009998 270.81 -2.73 2011
          18898 1       20.15 270.81 -2.73 2011
          18899 1       21.13 270.81 -2.73 2011
          18900 1       20.25 270.81 -2.73 2011
          18904 1   18.939999 270.81 -2.73 2011
          18905 1       19.42 270.81 -2.73 2011
          18906 1       19.42 270.81 -2.73 2011
          18907 1       19.25 270.81 -2.73 2011
          18910 1        19.6 270.81 -2.73 2011
          18911 1       19.57 270.81 -2.73 2011
          18912 1       20.06 270.81 -2.73 2011
          18913 1       19.48 270.81 -2.73 2011
          18914 1       19.45 270.81 -2.73 2011
          18917 1   18.919998 270.81 -2.73 2011
          18918 1       18.91 270.81 -2.73 2011
          18919 1       18.61 270.81 -2.73 2011
          18920 1       18.45 270.81 -2.73 2011
          18921 1       19.04 270.81 -2.73 2011
          18924 1       18.77 270.81 -2.73 2011
          18925 1       18.64 270.81 -2.73 2011
          18926 1       18.54 270.81 -2.73 2011
          18927 1       19.15 270.81 -2.73 2011
          18928 1       18.86 270.81 -2.73 2011
          18931 1       19.02 270.81 -2.73 2011
          18932 1       18.09 270.81 -2.73 2011
          18933 1   17.619999 270.81 -2.73 2011
          18934 1       18.14 270.81 -2.73 2011
          18935 1   18.060001 270.81 -2.73 2011
          18938 1       19.33 270.81 -2.73 2011
          18939 1       19.16 270.81 -2.73 2011
          18940 1       17.71 270.81 -2.73 2011
          18941 1   17.919998 270.81 -2.73 2011
          18942 1   18.169998 270.81 -2.73 2011
          18945 1   17.810001 270.81 -2.73 2011
          18946 1   17.529999 270.81 -2.73 2011
          18947 1   17.380001 270.81 -2.73 2011
          18948 1       17.23 270.81 -2.73 2011
          18949 1       15.96 270.81 -2.73 2011
          18952 1       15.31 270.81 -2.73 2011
          18953 1       15.45 270.81 -2.73 2011
          18954 1       14.47 270.81 -2.73 2011
          18955 1       14.32 270.81 -2.73 2011
          18956 1       13.03 270.81 -2.73 2011
          18959 1       13.34 270.81 -2.73 2011
          18960 1   12.150002 270.81 -2.73 2011
          18961 1       13.23 270.81 -2.73 2011
          18962 1       12.45 270.81 -2.73 2011
          18963 1   12.580002 270.81 -2.73 2011
          18966 1       11.81 270.81 -2.73 2011
          18967 1       11.87 270.81 -2.73 2011
          18968 1       12.07 270.81 -2.73 2011
          18969 1       13.02 270.81 -2.73 2011
          18970 1       13.28 270.81 -2.73 2011
          18973 1       13.05 270.81 -2.73 2011
          18974 1       12.86 270.81 -2.73 2011
          18975 1   12.349998 270.81 -2.73 2011
          18976 1       11.46 270.81 -2.73 2011
          18977 1       11.63 270.81 -2.73 2011
          18980 1    9.689999 270.81 -2.73 2011
          18981 1   11.169998 270.81 -2.73 2011
          18982 1       10.71 270.81 -2.73 2011
          18983 1       11.32 270.81 -2.73 2011
          18984 1       11.12 270.81 -2.73 2011
          18988 1       11.09 270.81 -2.73 2011
          18989 1    9.689999 270.81 -2.73 2011
          18990 1    9.860001 270.81 -2.73 2011
          18991 1    8.450001 270.81 -2.73 2011
          19176 1    9.849998 159.07  -.35 2012
          19177 1   10.379997 159.07  -.35 2012
          19178 1       10.23 159.07  -.35 2012
          19179 1       10.43 159.07  -.35 2012
          19180 1   10.649998 159.07  -.35 2012
          19183 1       10.05 159.07  -.35 2012
          19184 1   10.219997 159.07  -.35 2012
          19185 1    9.899998 159.07  -.35 2012
          19186 1        9.75 159.07  -.35 2012
          19187 1        9.82 159.07  -.35 2012
          19190 1    9.869999 159.07  -.35 2012
          19191 1         9.5 159.07  -.35 2012
          19192 1    9.689999 159.07  -.35 2012
          19193 1    9.549999 159.07  -.35 2012
          19194 1        9.68 159.07  -.35 2012
          19197 1    9.259998 159.07  -.35 2012
          19198 1    9.289997 159.07  -.35 2012
          19199 1        9.16 159.07  -.35 2012
          19200 1    9.349998 159.07  -.35 2012
          19201 1    9.439999 159.07  -.35 2012
          19204 1    9.360001 159.07  -.35 2012
          19205 1    9.699997 159.07  -.35 2012
          19206 1    9.939999 159.07  -.35 2012
          19207 1        9.77 159.07  -.35 2012
          19208 1        9.98 159.07  -.35 2012
          19211 1    9.919998 159.07  -.35 2012
          19212 1    9.919998 159.07  -.35 2012
          19213 1          10 159.07  -.35 2012
          19214 1    9.849998 159.07  -.35 2012
          19215 1    9.919998 159.07  -.35 2012
          19218 1       10.44 159.07  -.35 2012
          19219 1       11.25 159.07  -.35 2012
          19220 1   10.579998 159.07  -.35 2012
          19221 1       10.43 159.07  -.35 2012
          19222 1        9.82 159.07  -.35 2012
          19225 1    9.639999 159.07  -.35 2012
          19226 1    9.849998 159.07  -.35 2012
          19227 1   10.239998 159.07  -.35 2012
          19228 1   10.469997 159.07  -.35 2012
          19229 1       10.28 159.07  -.35 2012
          19232 1    9.919998 159.07  -.35 2012
          19233 1    9.739998 159.07  -.35 2012
          19234 1    9.389999 159.07  -.35 2012
          19235 1    9.389999 159.07  -.35 2012
          19236 1    9.369999 159.07  -.35 2012
          19239 1        9.32 159.07  -.35 2012
          19240 1        9.57 159.07  -.35 2012
          19241 1        9.34 159.07  -.35 2012
          19242 1   10.099998 159.07  -.35 2012
          19243 1        9.66 159.07  -.35 2012
          19246 1        9.43 159.07  -.35 2012
          19247 1           9 159.07  -.35 2012
          19248 1    9.099998 159.07  -.35 2012
          19249 1    8.789997 159.07  -.35 2012
          19250 1    8.969997 159.07  -.35 2012
          19253 1        8.75 159.07  -.35 2012
          19254 1        8.68 159.07  -.35 2012
          19255 1        8.59 159.07  -.35 2012
          19256 1        8.27 159.07  -.35 2012
          19257 1    8.189999 159.07  -.35 2012
          19260 1    7.459999 159.07  -.35 2012
          19261 1        7.34 159.07  -.35 2012
          19262 1    7.599998 159.07  -.35 2012
          19263 1    7.199997 159.07  -.35 2012
          19264 1    6.559998 159.07  -.35 2012
          19267 1    6.329998 159.07  -.35 2012
          19268 1        6.27 159.07  -.35 2012
          19270 1           7 159.07  -.35 2012
          19271 1    7.849998 159.07  -.35 2012
          19274 1    7.119999 159.07  -.35 2012
          19275 1    6.719997 159.07  -.35 2012
          19276 1        6.57 159.07  -.35 2012
          19277 1    6.860001 159.07  -.35 2012
          19278 1    6.610001 159.07  -.35 2012
          19281 1        6.09 159.07  -.35 2012
          19282 1    6.299999 159.07  -.35 2012
          19283 1        6.41 159.07  -.35 2012
          19284 1    7.129997 159.07  -.35 2012
          19285 1    7.469997 159.07  -.35 2012
          19288 1         7.5 159.07  -.35 2012
          19289 1        7.07 159.07  -.35 2012
          19290 1    6.689999 159.07  -.35 2012
          19291 1    6.860001 159.07  -.35 2012
          19292 1    7.079998 159.07  -.35 2012
          19295 1        6.57 159.07  -.35 2012
          19296 1    6.059998 159.07  -.35 2012
          19297 1    6.329998 159.07  -.35 2012
          19298 1        5.75 159.07  -.35 2012
          19299 1    6.629997 159.07  -.35 2012
          19302 1        5.82 159.07  -.35 2012
          19303 1    6.329998 159.07  -.35 2012
          19304 1        5.59 159.07  -.35 2012
          19305 1        6.23 159.07  -.35 2012
          19306 1    5.919998 159.07  -.35 2012
          19309 1        7.07 159.07  -.35 2012
          19310 1    6.639999 159.07  -.35 2012
          19311 1    6.699997 159.07  -.35 2012
          19312 1    6.529999 159.07  -.35 2012
          19313 1        6.23 159.07  -.35 2012
          19316 1    5.889999 159.07  -.35 2012
          19317 1    5.439999 159.07  -.35 2012
          19318 1    5.209999 159.07  -.35 2012
          19319 1        5.32 159.07  -.35 2012
          19320 1    6.059998 159.07  -.35 2012
          19323 1        5.73 159.07  -.35 2012
          19324 1    5.279999 159.07  -.35 2012
          19325 1    5.559998 159.07  -.35 2012
          19326 1    5.099998 159.07  -.35 2012
          19327 1        5.34 159.07  -.35 2012
          19330 1        6.25 159.07  -.35 2012
          19331 1    5.919998 159.07  -.35 2012
          19332 1    5.739998 159.07  -.35 2012
          19333 1    5.289997 159.07  -.35 2012
          19334 1        5.48 159.07  -.35 2012
          19337 1    4.799999 159.07  -.35 2012
          19338 1    4.329998 159.07  -.35 2012
          19339 1   4.4799995 159.07  -.35 2012
          19340 1   4.1800003 159.07  -.35 2012
          19341 1   3.9799995 159.07  -.35 2012
          19344 1   3.3499985 159.07  -.35 2012
          19345 1   3.5999985 159.07  -.35 2012
          19346 1   3.5200005 159.07  -.35 2012
          19347 1    3.549999 159.07  -.35 2012
          19348 1    2.869999 159.07  -.35 2012
          19354 1  -2.1800003 159.07  -.35 2012
          19355 1  -1.0200005 159.07  -.35 2012
          18840 2    8.540001 272.02   2.7 2011
          18841 2    8.630001 272.02   2.7 2011
          18842 2    7.849998 272.02   2.7 2011
          18843 2    7.799999 272.02   2.7 2011
          18844 2        7.16 272.02   2.7 2011
          18847 2    7.549999 272.02   2.7 2011
          18848 2    7.489998 272.02   2.7 2011
          18849 2    7.919998 272.02   2.7 2011
          18850 2        7.77 272.02   2.7 2011
          18851 2    7.700001 272.02   2.7 2011
          18854 2    7.919998 272.02   2.7 2011
          18855 2    8.220001 272.02   2.7 2011
          18856 2        7.75 272.02   2.7 2011
          18857 2    7.470001 272.02   2.7 2011
          18858 2    7.619999 272.02   2.7 2011
          18861 2    8.549999 272.02   2.7 2011
          18862 2       10.18 272.02   2.7 2011
          18863 2       10.22 272.02   2.7 2011
          18864 2    9.989998 272.02   2.7 2011
          18865 2          10 272.02   2.7 2011
          18868 2   10.349998 272.02   2.7 2011
          18869 2       11.41 272.02   2.7 2011
          18870 2   10.759998 272.02   2.7 2011
          18871 2   11.079998 272.02   2.7 2011
          18872 2       10.02 272.02   2.7 2011
          18875 2       10.11 272.02   2.7 2011
          18876 2        11.2 272.02   2.7 2011
          18877 2       10.46 272.02   2.7 2011
          18878 2       11.05 272.02   2.7 2011
          18879 2       10.04 272.02   2.7 2011
          18882 2    9.649998 272.02   2.7 2011
          18883 2        9.66 272.02   2.7 2011
          18884 2    9.439999 272.02   2.7 2011
          18885 2    9.639999 272.02   2.7 2011
          18886 2    8.619999 272.02   2.7 2011
          18889 2        8.23 272.02   2.7 2011
          18890 2        8.82 272.02   2.7 2011
          18891 2    8.279999 272.02   2.7 2011
          18892 2        7.48 272.02   2.7 2011
          18893 2    6.849998 272.02   2.7 2011
          18896 2    6.939999 272.02   2.7 2011
          18897 2    6.700001 272.02   2.7 2011
          18898 2    6.880001 272.02   2.7 2011
          18899 2        7.59 272.02   2.7 2011
          18900 2    7.360001 272.02   2.7 2011
          18904 2    5.299999 272.02   2.7 2011
          18905 2    6.130001 272.02   2.7 2011
          18906 2        5.68 272.02   2.7 2011
          18907 2    6.200001 272.02   2.7 2011
          18910 2        7.59 272.02   2.7 2011
          18911 2    6.759998 272.02   2.7 2011
          18912 2    7.139999 272.02   2.7 2011
          18913 2    6.349998 272.02   2.7 2011
          18914 2    6.619999 272.02   2.7 2011
          18917 2    7.549999 272.02   2.7 2011
          18918 2        6.98 272.02   2.7 2011
          18919 2    6.950001 272.02   2.7 2011
          18920 2        6.32 272.02   2.7 2011
          18921 2    6.459999 272.02   2.7 2011
          18924 2    6.889999 272.02   2.7 2011
          18925 2           7 272.02   2.7 2011
          18926 2    7.169998 272.02   2.7 2011
          18927 2        6.52 272.02   2.7 2011
          18928 2        6.41 272.02   2.7 2011
          18931 2    6.529999 272.02   2.7 2011
          18932 2    5.799999 272.02   2.7 2011
          18933 2    5.639999 272.02   2.7 2011
          18934 2    5.989998 272.02   2.7 2011
          18935 2    6.279999 272.02   2.7 2011
          18938 2    7.399998 272.02   2.7 2011
          18939 2    7.509998 272.02   2.7 2011
          18940 2    6.360001 272.02   2.7 2011
          18941 2    5.899998 272.02   2.7 2011
          18942 2        5.84 272.02   2.7 2011
          18945 2    5.529999 272.02   2.7 2011
          18946 2        5.27 272.02   2.7 2011
          18947 2        5.52 272.02   2.7 2011
          18948 2    5.239998 272.02   2.7 2011
          18949 2    4.899998 272.02   2.7 2011
          18952 2    4.209999 272.02   2.7 2011
          18953 2        4.82 272.02   2.7 2011
          18954 2   4.3999977 272.02   2.7 2011
          18955 2   3.7299995 272.02   2.7 2011
          18956 2    3.040001 272.02   2.7 2011
          18959 2   3.3499985 272.02   2.7 2011
          18960 2    2.329998 272.02   2.7 2011
          18961 2        3.07 272.02   2.7 2011
          18962 2    2.130001 272.02   2.7 2011
          18963 2   2.1399994 272.02   2.7 2011
          18966 2   1.5099983 272.02   2.7 2011
          18967 2   1.7999992 272.02   2.7 2011
          18968 2    2.369999 272.02   2.7 2011
          18969 2           3 272.02   2.7 2011
          18970 2    3.200001 272.02   2.7 2011
          18973 2    2.700001 272.02   2.7 2011
          18974 2    2.950001 272.02   2.7 2011
          18975 2    1.959999 272.02   2.7 2011
          18976 2    1.790001 272.02   2.7 2011
          18977 2    1.459999 272.02   2.7 2011
          18980 2   1.6499977 272.02   2.7 2011
          18981 2   2.0599976 272.02   2.7 2011
          18982 2    1.869999 272.02   2.7 2011
          18983 2    2.119999 272.02   2.7 2011
          18984 2    2.380001 272.02   2.7 2011
          18988 2        2.59 272.02   2.7 2011
          18989 2    1.369999 272.02   2.7 2011
          18990 2   1.6100006 272.02   2.7 2011
          18991 2    .3600006 272.02   2.7 2011
          18994 2   -.3500023 272.02   2.7 2012
          18995 2  -1.2999992 272.02   2.7 2012
          18996 2  -1.9700012 272.02   2.7 2012
          18997 2  -1.5499992 272.02   2.7 2012
          18998 2   -2.209999 272.02   2.7 2012
          19001 2  -1.0400009 272.02   2.7 2012
          19002 2   -1.790001 272.02   2.7 2012
          19003 2   -.6800003 272.02   2.7 2012
          19004 2  -1.1399994 272.02   2.7 2012
          19005 2   -1.459999 272.02   2.7 2012
          19008 2  -3.6100006 272.02   2.7 2012
          19009 2  -4.4300003 272.02   2.7 2012
          19010 2  -4.3199997 272.02   2.7 2012
          19011 2  -4.0200005 272.02   2.7 2012
          19012 2       -3.18 272.02   2.7 2012
          19015 2       -2.91 272.02   2.7 2012
          19016 2  -3.1399994 272.02   2.7 2012
          19017 2   -2.549999 272.02   2.7 2012
          19018 2   -2.740002 272.02   2.7 2012
          19019 2  -.27000046 272.02   2.7 2012
          19022 2    1.239998 272.02   2.7 2012
          19023 2 -.010002136 272.02   2.7 2012
          19206 2        7.82 106.95    .2 2012
          19207 2    7.939999 106.95    .2 2012
          19208 2    8.279999 106.95    .2 2012
          19211 2    8.330002 106.95    .2 2012
          19212 2    8.709999 106.95    .2 2012
          19213 2    8.369999 106.95    .2 2012
          19214 2    8.400002 106.95    .2 2012
          19215 2    8.610001 106.95    .2 2012
          19218 2    8.939999 106.95    .2 2012
          19219 2    9.619999 106.95    .2 2012
          19220 2    9.240002 106.95    .2 2012
          19221 2    9.049999 106.95    .2 2012
          19222 2    8.299999 106.95    .2 2012
          19225 2    8.529999 106.95    .2 2012
          19226 2    8.560001 106.95    .2 2012
          19227 2    8.619999 106.95    .2 2012
          19228 2    9.009998 106.95    .2 2012
          19229 2        8.91 106.95    .2 2012
          19232 2    8.330002 106.95    .2 2012
          19233 2    8.349998 106.95    .2 2012
          19234 2    8.169998 106.95    .2 2012
          19235 2    8.040001 106.95    .2 2012
          19236 2    7.919998 106.95    .2 2012
          19239 2        8.34 106.95    .2 2012
          19240 2    8.720001 106.95    .2 2012
          19241 2    8.049999 106.95    .2 2012
          19242 2    8.259998 106.95    .2 2012
          19243 2    8.330002 106.95    .2 2012
          19246 2    7.919998 106.95    .2 2012
          19247 2    7.669998 106.95    .2 2012
          19248 2    7.470001 106.95    .2 2012
          19249 2    7.869999 106.95    .2 2012
          19250 2    7.639999 106.95    .2 2012
          19253 2    7.110001 106.95    .2 2012
          19254 2    6.669998 106.95    .2 2012
          19255 2    5.869999 106.95    .2 2012
          19256 2        6.23 106.95    .2 2012
          19257 2    6.080002 106.95    .2 2012
          19260 2    5.080002 106.95    .2 2012
          19261 2    5.790001 106.95    .2 2012
          19262 2        5.52 106.95    .2 2012
          19263 2    5.709999 106.95    .2 2012
          19264 2    4.790001 106.95    .2 2012
          19267 2    4.919998 106.95    .2 2012
          19268 2   4.6800003 106.95    .2 2012
          19270 2    5.380001 106.95    .2 2012
          19271 2    6.380001 106.95    .2 2012
          19274 2    6.130001 106.95    .2 2012
          19275 2    6.139999 106.95    .2 2012
          19276 2    6.209999 106.95    .2 2012
          19277 2    5.759998 106.95    .2 2012
          19278 2        5.68 106.95    .2 2012
          19281 2   4.6899986 106.95    .2 2012
          19282 2        5.41 106.95    .2 2012
          19283 2    5.599998 106.95    .2 2012
          19284 2    6.029999 106.95    .2 2012
          19285 2        6.41 106.95    .2 2012
          19288 2        6.57 106.95    .2 2012
          19289 2        6.07 106.95    .2 2012
          19290 2    6.130001 106.95    .2 2012
          19291 2    6.400002 106.95    .2 2012
          19292 2    6.509998 106.95    .2 2012
          19295 2    6.549999 106.95    .2 2012
          19296 2    6.150002 106.95    .2 2012
          19297 2    6.740002 106.95    .2 2012
          19298 2    6.259998 106.95    .2 2012
          19299 2        6.18 106.95    .2 2012
          19302 2    5.439999 106.95    .2 2012
          19303 2    6.080002 106.95    .2 2012
          19304 2    5.889999 106.95    .2 2012
          19305 2    6.139999 106.95    .2 2012
          19306 2        5.68 106.95    .2 2012
          19309 2    6.389999 106.95    .2 2012
          19310 2    5.709999 106.95    .2 2012
          19311 2    5.950001 106.95    .2 2012
          19312 2        5.77 106.95    .2 2012
          19313 2    5.200001 106.95    .2 2012
          19316 2   4.6899986 106.95    .2 2012
          19317 2        4.98 106.95    .2 2012
          19318 2   4.7599983 106.95    .2 2012
          19319 2         4.5 106.95    .2 2012
          19320 2        5.07 106.95    .2 2012
          19323 2    4.529999 106.95    .2 2012
          19324 2   4.4799995 106.95    .2 2012
          19325 2    4.880001 106.95    .2 2012
          19326 2   4.6800003 106.95    .2 2012
          19327 2   4.1800003 106.95    .2 2012
          19330 2    5.060001 106.95    .2 2012
          19331 2    4.830002 106.95    .2 2012
          19332 2        4.82 106.95    .2 2012
          19333 2    4.549999 106.95    .2 2012
          19334 2         4.5 106.95    .2 2012
          19337 2    4.700001 106.95    .2 2012
          19338 2   4.3100014 106.95    .2 2012
          19339 2   4.1500015 106.95    .2 2012
          19340 2    3.580002 106.95    .2 2012
          19341 2   3.5200005 106.95    .2 2012
          19344 2           3 106.95    .2 2012
          19345 2    3.619999 106.95    .2 2012
          19346 2    3.549999 106.95    .2 2012
          19347 2    3.549999 106.95    .2 2012
          19348 2   3.5200005 106.95    .2 2012
          19354 2    2.130001 106.95    .2 2012
          19355 2   3.0200005 106.95    .2 2012
          end
          format %td date
          label var x1 "Variance_offpeak_at_Delivery" 
          label var x2 "Skew_offpeak_at_Delivery"

          Code:
          xtset entity date
          Code:
          xtscc y x1 x2 i.entity i.year

          Comment


          • #6
            One thing that you can do, is assume that you do not have an interruption in your data, and that the 2012 data comes immediately after 2011 data. It is a bit dodgy, but this is basically what we do when we assume that there was no weekend and Monday comes immediately after Friday:

            Code:
            . sort entity date
            
            . by entity: gen time = _n
            
            . xtset entity time
                   panel variable:  entity (unbalanced)
                    time variable:  time, 1 to 255
                            delta:  1 unit
            
            . xtscc y x1 x2 i.entity i.year
            
            Regression with Driscoll-Kraay standard errors   Number of obs     =       489
            Method: Pooled OLS                               Number of groups  =         2
            Group variable (i): entity                       F(  4,   254)     =    179.15
            maximum lag: 4                                   Prob > F          =    0.0000
                                                             R-squared         =    0.8113
                                                             Root MSE          =    2.7156
            
            ------------------------------------------------------------------------------
                         |             Drisc/Kraay
                       y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                      x1 |  -.0205242    .005398    -3.80   0.000    -.0311548   -.0098936
                      x2 |  -1.932772   .2114677    -9.14   0.000    -2.349225   -1.516319
                         |
                  entity |
                      1  |          0  (empty)
                      2  |  -1.384419   .5995941    -2.31   0.022    -2.565228   -.2036098
                         |
                    year |
                   2011  |          0  (empty)
                   2012  |  -8.294924   .7776757   -10.67   0.000    -9.826438    -6.76341
                         |
                   _cons |   18.50673   1.692456    10.93   0.000      15.1737    21.83976
            ------------------------------------------------------------------------------
            
            
            . xtscc y x1 x2 i.entity i.year, lag(3)
            
            Regression with Driscoll-Kraay standard errors   Number of obs     =       489
            Method: Pooled OLS                               Number of groups  =         2
            Group variable (i): entity                       F(  4,   254)     =    204.07
            maximum lag: 3                                   Prob > F          =    0.0000
                                                             R-squared         =    0.8113
                                                             Root MSE          =    2.7156
            
            ------------------------------------------------------------------------------
                         |             Drisc/Kraay
                       y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                      x1 |  -.0205242   .0050438    -4.07   0.000    -.0304571   -.0105913
                      x2 |  -1.932772   .1915948   -10.09   0.000    -2.310089   -1.555455
                         |
                  entity |
                      1  |          0  (empty)
                      2  |  -1.384419   .5494828    -2.52   0.012    -2.466542   -.3022964
                         |
                    year |
                   2011  |          0  (empty)
                   2012  |  -8.294924   .7233272   -11.47   0.000    -9.719407   -6.870441
                         |
                   _cons |   18.50673   1.577624    11.73   0.000     15.39984    21.61362
            ------------------------------------------------------------------------------
            
            
            .

            Comment


            • #7
              Joro Kolev this works well! Thank you

              Comment

              Working...
              X