Announcement

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

  • #16
    --------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float cid str14 country float qdate double gdp float(date1 mpr_per_annm mdate) byte _merge
    1 "Argentina" 180 1.300e+11 180  2.75 540 3
    1 "Argentina" 180 1.300e+11 180  2.75 541 3
    1 "Argentina" 180 1.300e+11 180  2.75 542 3
    1 "Argentina" 181 1.300e+11 181  3.25 543 3
    1 "Argentina" 181 1.300e+11 181  3.75 544 3
    1 "Argentina" 181 1.300e+11 181  4.25 545 3
    1 "Argentina" 182 1.300e+11 182  4.25 546 3
    1 "Argentina" 182 1.300e+11 182  4.25 547 3
    1 "Argentina" 182 1.300e+11 182  4.25 548 3
    1 "Argentina" 183 1.400e+11 183   4.5 549 3
    1 "Argentina" 183 1.400e+11 183   4.5 550 3
    1 "Argentina" 183 1.400e+11 183     5 551 3
    1 "Argentina" 184 1.400e+11 184     5 552 3
    1 "Argentina" 184 1.400e+11 184     5 553 3
    1 "Argentina" 184 1.400e+11 184     5 554 3
    1 "Argentina" 185 1.400e+11 185     5 555 3
    1 "Argentina" 185 1.400e+11 185   5.5 556 3
    1 "Argentina" 185 1.400e+11 185  5.75 557 3
    1 "Argentina" 186 1.400e+11 186  5.75 558 3
    1 "Argentina" 186 1.400e+11 186  5.75 559 3
    1 "Argentina" 186 1.400e+11 186  5.75 560 3
    1 "Argentina" 187 1.500e+11 187     6 561 3
    1 "Argentina" 187 1.500e+11 187  6.25 562 3
    1 "Argentina" 187 1.500e+11 187  6.25 563 3
    1 "Argentina" 188 1.500e+11 188   6.5 564 3
    1 "Argentina" 188 1.500e+11 188  6.75 565 3
    1 "Argentina" 188 1.500e+11 188  10.4 566 3
    1 "Argentina" 189 1.500e+11 189 10.31 567 3
    1 "Argentina" 189 1.500e+11 189 10.33 568 3
    1 "Argentina" 189 1.500e+11 189 10.25 569 3
    1 "Argentina" 190 1.600e+11 190 10.31 570 3
    1 "Argentina" 190 1.600e+11 190  10.5 571 3
    1 "Argentina" 190 1.600e+11 190 10.37 572 3
    1 "Argentina" 191 1.600e+11 191  10.7 573 3
    1 "Argentina" 191 1.600e+11 191 10.65 574 3
    1 "Argentina" 191 1.600e+11 191 10.75 575 3
    1 "Argentina" 192 1.600e+11 192    11 576 3
    1 "Argentina" 192 1.600e+11 192  11.3 577 3
    1 "Argentina" 192 1.600e+11 192 11.07 578 3
    1 "Argentina" 193 1.600e+11 193 11.52 579 3
    1 "Argentina" 193 1.600e+11 193  11.8 580 3
    1 "Argentina" 193 1.600e+11 193 11.84 581 3
    1 "Argentina" 194 1.600e+11 194  12.2 582 3
    1 "Argentina" 194 1.600e+11 194  12.2 583 3
    1 "Argentina" 194 1.600e+11 194 12.26 584 3
    1 "Argentina" 195 1.600e+11 195 12.48 585 3
    1 "Argentina" 195 1.600e+11 195  12.5 586 3
    1 "Argentina" 195 1.600e+11 195 12.05 587 3
    1 "Argentina" 196 1.500e+11 196  12.5 588 3
    1 "Argentina" 196 1.500e+11 196  13.4 589 3
    1 "Argentina" 196 1.500e+11 196    14 590 3
    1 "Argentina" 197 1.500e+11 197 14.35 591 3
    1 "Argentina" 197 1.500e+11 197 14.55 592 3
    1 "Argentina" 197 1.500e+11 197 16.25 593 3
    1 "Argentina" 198 1.500e+11 198 14.59 594 3
    1 "Argentina" 198 1.500e+11 198 15.89 595 3
    1 "Argentina" 198 1.500e+11 198  9.75 596 3
    1 "Argentina" 199 1.600e+11 199   9.5 597 3
    1 "Argentina" 199 1.600e+11 199   9.5 598 3
    1 "Argentina" 199 1.600e+11 199   9.5 599 3
    1 "Argentina" 200 1.600e+11 200   9.5 600 3
    1 "Argentina" 200 1.600e+11 200   9.5 601 3
    1 "Argentina" 200 1.600e+11 200   9.5 602 3
    1 "Argentina" 201 1.700e+11 201   9.5 603 3
    1 "Argentina" 201 1.700e+11 201   9.5 604 3
    1 "Argentina" 201 1.700e+11 201   9.5 605 3
    1 "Argentina" 202 1.700e+11 202   9.5 606 3
    1 "Argentina" 202 1.700e+11 202   9.5 607 3
    1 "Argentina" 202 1.700e+11 202   9.5 608 3
    1 "Argentina" 203 1.700e+11 203   9.5 609 3
    1 "Argentina" 203 1.700e+11 203   9.5 610 3
    1 "Argentina" 203 1.700e+11 203   9.5 611 3
    1 "Argentina" 204 1.800e+11 204   9.5 612 3
    1 "Argentina" 204 1.800e+11 204   9.5 613 3
    1 "Argentina" 204 1.800e+11 204   9.5 614 3
    1 "Argentina" 205 1.800e+11 205   9.5 615 3
    1 "Argentina" 205 1.800e+11 205   9.5 616 3
    1 "Argentina" 205 1.800e+11 205   9.5 617 3
    1 "Argentina" 206 1.800e+11 206   9.5 618 3
    1 "Argentina" 206 1.800e+11 206   9.5 619 3
    1 "Argentina" 206 1.800e+11 206   9.5 620 3
    1 "Argentina" 207 1.800e+11 207   9.5 621 3
    1 "Argentina" 207 1.800e+11 207   9.5 622 3
    1 "Argentina" 207 1.800e+11 207   9.5 623 3
    1 "Argentina" 208 1.800e+11 208   9.5 624 3
    1 "Argentina" 208 1.800e+11 208   9.5 625 3
    1 "Argentina" 208 1.800e+11 208   9.5 626 3
    1 "Argentina" 209 1.700e+11 209   9.5 627 3
    1 "Argentina" 209 1.700e+11 209   9.5 628 3
    1 "Argentina" 209 1.700e+11 209   9.5 629 3
    1 "Argentina" 210 1.800e+11 210   9.5 630 3
    1 "Argentina" 210 1.800e+11 210   9.5 631 3
    1 "Argentina" 210 1.800e+11 210   9.5 632 3
    1 "Argentina" 211 1.800e+11 211   9.5 633 3
    1 "Argentina" 211 1.800e+11 211   9.5 634 3
    1 "Argentina" 211 1.800e+11 211   9.5 635 3
    1 "Argentina" 212 1.800e+11 212   9.5 636 3
    1 "Argentina" 212 1.800e+11 212   9.5 637 3
    1 "Argentina" 212 1.800e+11 212   9.5 638 3
    1 "Argentina" 213 1.800e+11 213   9.5 639 3
    end
    format %tm qdate
    format %tq date1
    label values _merge _merge
    label def _merge 3 "Matched  (3)", modify
    ------------------ copy up to and including the previous line ----------

    After xtset the output I got is different from the above.

    xtset cid mdate Panel variable: cid (strongly balanced)
    Time variable: mdate, 540 to 746
    Delta: 1 unit

    Comment


    • #17
      This data set you show is radically different from the previous example. This data set already has observations for every month. There is nothing to fill in, and, in fact, if you compare the data before and after -tsfill-, they are identical. I do notice that the values of gdp for all months in the same quarter are the same. But that is the case at the start in this data set.

      The bottom line here is that this data set has no need of being filled in. It is already filled in to begin with. Perhaps however that got filled in was incorrect, but as there is no information about how this got created, there is nothing I can say about that. In any case, this data set does not show a problem with the code. The problem is with the data set itself.

      Comment


      • #18
        I'm still having this same problem. Wouldn't mind sharing the data file here if it's allowed.

        Comment


        • #19
          Sharing data sets here is allowed, but discouraged. It is discouraged, in part, because some users are reluctant to download files from people they do not know. I am among them. While I have no concerns that you would deliberately send me a malware-containing file, I have no idea what malware you might unknowingly have on your installation by virtue of your computing habits and those of every single person with whom you do interchange information! It's a dangerous world on the internet, and I, for one, feel I can never be too careful.

          If by "this same problem" you mean that when you use -tsfill- the new observations come in pre-populated with copies of the previously existing data, rather than the missing values you want, it is hard for me to understand why something like that would happen in your full data set, yet you cannot find an example small enough to post with -dataex- that reproduces the problem. And I still have difficulty imagining what could cause the problem in any case. It is right there in the help file for -tsfill-, in the Description section:
          Description

          tsfill is used to fill in gaps in time-series data and gaps in panel data with new observations, which contain missing values....
          [Emphasis added]
          Here's a thought: are you using some very old version of Stata? Perhaps a long time ago the description for -tsfill- specified that data was filled in some other way in the newly created observations. It would have to be a long time ago, though. Run -help tsfill- and see what it says under Description.

          Comment

          Working...
          X