Announcement

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

  • Denton command error: Sample may not include multiple panels

    . denton GDP_IN using indonesia2_denton.dta, interp(GDP_IN) from(indonesia2.dta) generate(gdp_in)

    sample may not include multiple panels
    r(459);

    Before running this command, I used: tsset GDP_IN year

    Data:

    Year GDP_IN year
    01dec1960 550703878.73 1960
    01dec1963 579777430.51 1963
    01dec1961 582317837.94 1961
    01dec1962 593044002.67 1962
    01dec1964 600241823.74 1964
    01dec1965 606733976.08 1965
    01dec1966 623670025.66 1966
    01dec1967 632279184.19 1967
    01dec1968 701293586.22 1968
    01dec1969 749137926.27 1969
    01dec1970 805732558.61 1970
    01dec1971 862327190.94 1971
    01dec1972 923014701.92 1972
    01dec1973 997815587.55 1973
    01dec1974 1070000000.00 1974
    01dec1975 1130000000.00 1975
    01dec1976 1210000000.00 1976
    01dec1977 1310000000.00 1977
    01dec1978 1400000000.00 1978
    01dec1979 1500000000.00 1979
    01dec1980 1650000000.00 1980
    01dec1981 1780000000.00 1981
    01dec1982 1820000000.00 1982
    01dec1983 1900000000.00 1983
    01dec1984 2030000000.00 1984
    01dec1985 2080000000.00 1985
    01dec1986 2200000000.00 1986
    01dec1987 2310000000.00 1987
    01dec1988 2440000000.00 1988
    01dec1989 2630000000.00 1989
    01dec1990 2820000000.00 1990
    01dec1991 3011078051.80 1991
    01dec1992 3206723044.50 1992
    01dec1993 3415044860.70 1993
    01dec1994 3672538256.10 1994
    01dec1998 3897609127.00 1998
    01dec1999 3928444129.40 1999
    01dec1995 3974421172.50 1995
    01dec2000 4121726242.00 2000
    01dec2001 4271899954.70 2001
    01dec1996 4285148855.00 1996
    01dec2002 4464113041.80 2002
    01dec1997 4486545659.90 1997
    01dec2003 4677514123.30 2003
    01dec2004 4912833962.60 2004
    01dec2005 5192500538.90 2005
    01dec2006 5478137490.00 2006
    01dec2007 5825726531.40 2007
    01dec2008 6176068457.50 2008
    01dec2009 6461950710.60 2009
    01dec2010 6864133100.00 2010
    01dec2011 7287635300.00 2011
    01dec2012 7727083400.00 2012
    01dec2013 8156497800.00 2013
    01dec2014 8564866600.00 2014
    01dec2015 8982517100.00 2015
    01dec2016 9434613400.00 2016
    01dec2017 9912928100.00 2017
    01dec2018 10425851900.00 2018
    01dec2020 10722999300.00 2020
    01dec2019 10949155400.00 2019
    01dec2021 11120077900.00 2021
    01dec2022 11710397800.00 2022

    GDP_IN is double type, year is float, and Year is int. I am using Stata 17.0
    Last edited by Jair Morales; 26 Jan 2024, 03:07.

  • #2
    denton is from SSC (FAQ Advice #12).

    'DENTON': module to interpolate a flow or stock series from low-frequency totals via proportional
    Denton method

    DESCRIPTION/AUTHOR(S)

    denton computes the proportional Denton method of interpolation
    of a low-frequency flow time series by use of an associated
    high-frequency "indicator series", imposing the constraints that
    the interpolated series obeys the low-frequency totals. The
    method is recommended in IMF publications as "relatively simple,
    robust, and well-suited for large-scale applications." It may be
    particularly useful in cases where, due to sizable statistical
    discrepancy, quarterly series do not integrate to annual totals.
    The indicator series only contribute their pattern to the
    interpolation. The routine can interpolate annual data to
    quarterly or monthly, and quarterly data to monthly. The stock
    option allows the routine to handle stock (rather than flow)
    series. A certification script for the package is provided.
    The issue is with your tsset command. This declares the time variable, and you should not include any additional variable. See

    Code:
    help tsset
    So change

    tsset GDP_IN year
    to

    Code:
    tsset year

    Comment


    • #3
      But this happens now:

      . tsset year

      Time variable: year, 1960 to 2022
      Delta: 1 year

      . denton GDP_IN using indonesia2_denton.dta, interp(GDP_IN) from(indonesia2.dta) generate(gdp_in)

      indonesia2.dta contains panel data.
      r(198);

      indonesia2.dta is what I have posted above for the data.

      Comment


      • #4
        Originally posted by Jair Morales View Post
        indonesia2.dta is what I have posted above for the data.
        It cannot be, because you got

        . tsset year

        Time variable: year, 1960 to 2022
        Delta: 1 year
        You need one file with the high frequency data and one with the low frequency data. The above appears to be "indonesia2_denton.dta". In any case, both need to be time series, so go and check out why indonesia2.dta is indicated as a panel.

        Code:
        use indonesia2.dta, clear
        dataex
        In addition:

        denton GDP_IN using indonesia2_denton.dta, interp(GDP_IN) from(indonesia2.dta) generate(gdp_in)
        should be different variables, where the former is the lower frequency variable and the latter is the higher frequency indicator. Review the command's documentation.

        Code:
        help denton
        Last edited by Andrew Musau; 26 Jan 2024, 03:55.

        Comment


        • #5
          I do not see the issue at the moment.

          Edit: I think I have figured it out.
          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input int Year double GDP_IN float year
            335 550703878.73 1960
           1430 579777430.51 1963
            700 582317837.94 1961
           1065 593044002.67 1962
           1796 600241823.74 1964
           2161 606733976.08 1965
           2526 623670025.66 1966
           2891 632279184.19 1967
           3257 701293586.22 1968
           3622 749137926.27 1969
           3987 805732558.61 1970
           4352 862327190.94 1971
           4718 923014701.92 1972
           5083 997815587.55 1973
           5448    1.070e+09 1974
           5813    1.130e+09 1975
           6179    1.210e+09 1976
           6544    1.310e+09 1977
           6909    1.400e+09 1978
           7274    1.500e+09 1979
           7640    1.650e+09 1980
           8005    1.780e+09 1981
           8370    1.820e+09 1982
           8735    1.900e+09 1983
           9101    2.030e+09 1984
           9466    2.080e+09 1985
           9831    2.200e+09 1986
          10196    2.310e+09 1987
          10562    2.440e+09 1988
          10927    2.630e+09 1989
          11292    2.820e+09 1990
          11657 3011078051.8 1991
          12023 3206723044.5 1992
          12388 3415044860.7 1993
          12753 3672538256.1 1994
          14214   3897609127 1998
          14579 3928444129.4 1999
          13118 3974421172.5 1995
          14945   4121726242 2000
          15310 4271899954.7 2001
          13484   4285148855 1996
          15675 4464113041.8 2002
          13849 4486545659.9 1997
          16040 4677514123.3 2003
          16406 4912833962.6 2004
          16771 5192500538.9 2005
          17136   5478137490 2006
          17501 5825726531.4 2007
          17867 6176068457.5 2008
          18232 6461950710.6 2009
          18597   6864133100 2010
          18962   7287635300 2011
          19328   7727083400 2012
          19693   8156497800 2013
          20058   8564866600 2014
          20423   8982517100 2015
          20789   9434613400 2016
          21154   9912928100 2017
          21519  10425851900 2018
          22250  10722999300 2020
          21884  10949155400 2019
          22615  11120077900 2021
          22980  11710397800 2022
          end
          format %td Year
          Last edited by Jair Morales; 26 Jan 2024, 04:10.

          Comment


          • #6
            The data are out of order in #5 but a check with

            Code:
            isid year
            identifies no problem. As Andrew Musau makes clear, there may be issues when you use the other dataset.

            Comment

            Working...
            X