Announcement

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

  • Creating time lags with multiple observations of the same date?

    I am very new to Stata.
    I am attempting to take a large sum of data and create time lags at weekly intervals for several different varieties of a variable. However, I can't seem to find a way past the issue of
    1) figuring out how to separate the different varieties to do lags for each separately
    2) overcoming the issue of multiple instances of the same date (I think solving 1 will fix this issue)

    If there's anything I can provide that would be useful, please let me know.
    Last edited by John Butler; 11 Nov 2018, 12:38.

  • #2
    The most useful thing you could do at the moment is read the Forum FAQ. There you will find lots of excellent advice about how to post clear questions, supplemented by usable and readable examples of your data. After doing that, try reposting your question. At a minimum, when you do that, you should:

    1. Post example data using the -dataex- command. If you are running version 15.1 or a fully updated version 14.2, it is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    2. Explain what you mean by "different varieties of a variable." I can't even really imagine what that might be.

    I think if you do those things, a timely and helpful response from somebody will follow.

    Comment


    • #3
      I have weekly retail price data on apples sold in the United States for the past 10 years. I would like to do a weekly time lag of the weighted average price for each variety of apple. However, it has gotten tricky with the different packaging sizes and the use of the same date so many times.

      My question is: How would you overcome the error "repeated time values in sample"?



      [CODE]
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      Date str18 Region str21 Variety str1 Organic str10 Environment str9 Unit str5 NumberofStores str17(WeightedAvgPrice LowPrice HighPrice) str3 MarkedLocal
      " 9/9/2016" "NATIONAL" "BRAEBURN" "" "" "3 lb bag" "30" "2.5" "" "" ""
      " 9/9/2016" "NATIONAL" "BRAEBURN" "" "" "per pound" "158" "1.36" "" "" ""
      " 9/9/2016" "NATIONAL" "BRAEBURN" "Y" "" "per pound" "180" "2.99" "" "" ""
      " 9/9/2016" "NATIONAL" "FUJI" "" "" "3 lb bag" "525" "3.79" "" "" ""
      " 9/9/2016" "NATIONAL" "FUJI" "" "" "per pound" "548" "1.28" "" "" ""
      " 9/9/2016" "NATIONAL" "FUJI" "Y" "" "per pound" "555" "2.32" "" "" ""
      " 9/9/2016" "NATIONAL" "GALA" "" "" "3 lb bag" "1161" "3.34" "" "" ""
      " 9/9/2016" "NATIONAL" "GALA" "" "" "5 lb bag" "175" "4.9" "" "" ""
      " 9/9/2016" "NATIONAL" "GALA" "" "" "per pound" "5734" "1.15" "" "" ""
      " 9/9/2016" "NATIONAL" "GALA" "Y" "" "3 lb bag" "467" "5.45" "" "" ""
      " 9/9/2016" "NATIONAL" "GALA" "Y" "" "per pound" "2558" "2.17" "" "" ""
      " 9/9/2016" "NATIONAL" "GINGER GOLD" "" "" "3 lb bag" "211" "3.05" "" "" ""
      " 9/9/2016" "NATIONAL" "GINGER GOLD" "" "" "per pound" "654" "1.17" "" "" ""
      " 9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "3 lb bag" "254" "2.97" "" "" ""
      " 9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "5 lb bag" "195" "3.98" "" "" ""
      " 9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "per pound" "1990" "1.16" "" "" ""
      " 9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "Y" "" "3 lb bag" "8" "4.99" "" "" ""
      " 9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "Y" "" "per pound" "13" "2.81" "" "" ""
      " 9/9/2016" "NATIONAL" "GRANNY SMITH" "" "" "3 lb bag" "194" "3.56" "" "" ""
      " 9/9/2016" "NATIONAL" "GRANNY SMITH" "" "" "per pound" "796" "1.02" "" "" ""
      " 9/9/2016" "NATIONAL" "GRANNY SMITH" "Y" "" "per pound" "288" "2.8" "" "" ""
      " 9/9/2016" "NATIONAL" "HONEYCRISP" "" "" "3 lb bag" "351" "4.79" "" "" ""
      " 9/9/2016" "NATIONAL" "HONEYCRISP" "" "" "per pound" "6544" "2.49" "" "" ""
      " 9/9/2016" "NATIONAL" "HONEYCRISP" "Y" "" "per pound" "1067" "3.41" ""
      Last edited by John Butler; 11 Nov 2018, 15:18.

      Comment


      • #4
        Frustrating!

        First, your -dataex- output is mangled. Did you edit it after you copied it into the Forum editor? It's a cardinal rule: never edit Results or code that you are showing. Always paste it in exactly as it was in your Results Window, do file, or log file. There is no such thing as a minor change. As it was, your -dataex- output required rreconstructive surgery to make it usable. For starters, the -input- command is missing, as is the storage type for Date. And the -end- command and closing code delimiter are also missing.

        Once in, I see that the data itself requires a lot of cleaning. It is not ready for analysis as it stands.

        First, you have this variable Organic which is sometimes Y and sometimes missing. I don't know where this practice of using missing values to mean No in a yes/no variable comes from, I see it a lot here, but it is not usable in Stata. When you have a dichotomous variable, never use missing value to represent one of the values. Always give it an explicit code. If the variable is numeric, use 0 for negative and 1 for positive. If it is a string, use a sensible string value, like, in this case, "N". Reserve missing values for those observations where it is actually not known whether the correct value is Y or N.

        Next, all your numeric variables are actually stored as strings. That makes them unusable for calculations (including lags--as you would have found out once you surmounted your repeated dates problem.) The fix for this is the -destring- command. But when you use it, you may hit a snag. I don't know where this data set came from, but if it was brought into Stata using -import excel- or -import delimited-, these variables should have come in as numeric in the first place. The fact that they did not suggests that in parts of the data set that are not shown here, the values are contaminated with non-numeric content. Perhaps missing values were entered as "N/A". Or maybe some values with a large number of digits have commas. Or it could be much worse than that. In any case, if you hit a snag with the destring command, you need to identify the non-numeric material that is obstructing your path and figure out how to deal with it. More on this below.

        Your date variable is also stored as a string, which makes it useless as a time variable in panel data. So it needs to be converted to a real Stata numeric date variable. I cannot tell from your example whether the dates are shown as Month-Day-Year or Day-Month-Year. In the code below, I assume the former.

        The final obstacle is to figure out how to set this data as panel data. The panel identifier is not immediately obvious. Clearly Region and Variety are not sufficient. With a little experimentation, it appears that Region Variety Organic and Unit together uniquely identify the observations. (Of course in your real data, which presumably has more than one date, you would also need the date variable to uniquely identify observations.) Does that make sense from your understanding of what this data represents? Will that apply to your data set as a whole, or is that just a fluke of this example?

        So based on this, the following code should do it for you:

        Code:
        * Example generated by -dataex-. To install: ssc install dataex                                                                                           
        clear                                                                                                                                                     
        input str8 Date str18 Region str21 Variety str1 Organic str10 Environment str9 Unit str5 NumberofStores str17(WeightedAvgPrice LowPrice HighPrice) str3 MarkedLocal  
        "9/9/2016" "NATIONAL" "BRAEBURN" "" "" "3 lb bag" "30" "2.5" "" "" ""                                                                                    
        "9/9/2016" "NATIONAL" "BRAEBURN" "" "" "per pound" "158" "1.36" "" "" ""                                                                               
        "9/9/2016" "NATIONAL" "BRAEBURN" "Y" "" "per pound" "180" "2.99" "" "" ""                                                                             
        "9/9/2016" "NATIONAL" "FUJI" "" "" "3 lb bag" "525" "3.79" "" "" ""                                                                                      
        "9/9/2016" "NATIONAL" "FUJI" "" "" "per pound" "548" "1.28" "" "" ""                                                                                     
        "9/9/2016" "NATIONAL" "FUJI" "Y" "" "per pound" "555" "2.32" "" "" ""                                                                                    
        "9/9/2016" "NATIONAL" "GALA" "" "" "3 lb bag" "1161" "3.34" "" "" ""                                                                                     
        "9/9/2016" "NATIONAL" "GALA" "" "" "5 lb bag" "175" "4.9" "" "" ""                                                                                       
        "9/9/2016" "NATIONAL" "GALA" "" "" "per pound" "5734" "1.15" "" "" ""                                                                                    
        "9/9/2016" "NATIONAL" "GALA" "Y" "" "3 lb bag" "467" "5.45" "" "" ""                                                                                     
        "9/9/2016" "NATIONAL" "GALA" "Y" "" "per pound" "2558" "2.17" "" "" ""                                                                                   
        "9/9/2016" "NATIONAL" "GINGER GOLD" "" "" "3 lb bag" "211" "3.05" "" "" ""                                                                              
        "9/9/2016" "NATIONAL" "GINGER GOLD" "" "" "per pound" "654" "1.17" "" "" ""                                                                          
        "9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "3 lb bag" "254" "2.97" "" "" ""                                                                   
        "9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "5 lb bag" "195" "3.98" "" "" ""                                                                   
        "9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "" "" "per pound" "1990" "1.16" "" "" ""                                                              
        "9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "Y" "" "3 lb bag" "8" "4.99" "" "" ""                                                                     
        "9/9/2016" "NATIONAL" "GOLDEN DELICIOUS" "Y" "" "per pound" "13" "2.81" "" "" ""                                                               
        "9/9/2016" "NATIONAL" "GRANNY SMITH" "" "" "3 lb bag" "194" "3.56" "" "" "" 
        "9/9/2016" "NATIONAL" "GRANNY SMITH" "" "" "per pound" "796" "1.02" "" "" ""
        "9/9/2016" "NATIONAL" "GRANNY SMITH" "Y" "" "per pound" "288" "2.8" "" "" "" 
        "9/9/2016" "NATIONAL" "HONEYCRISP" "" "" "3 lb bag" "351" "4.79" "" "" "" 
        "9/9/2016" "NATIONAL" "HONEYCRISP" "" "" "per pound" "6544" "2.49" "" "" "" 
        "9/9/2016" "NATIONAL" "HONEYCRISP" "Y" "" "per pound" "1067" "3.41" "" 
        end
        
        gen date = daily(Date, "MDY")
        format date %td
        order date, first
        drop Date
        
        replace Organic = "N" if missing(Organic)
        
        destring *Price, replace
        
        egen specific = group(Region Variety Unit Organic)
        
        xtset specific date
        At this point, you can calculate lagged prices with commands like
        Code:
        gen prior_avg_price = L1.WeightedAvgPrice
        and the like.

        If, as I suggested above may happen, -destring- fails to convert the price variables to string, you can identify the offending observations with

        Code:
        browse if missing(real(WeightedAvgPrice), real(LowPrice), real(HighPrice))
        By the way, next time if you want help with things like computing lagged values, it would make sense for your data example to include more than one date, and in particular, for it to include some date and the immediately preceding date.

        Comment


        • #5
          I apologize for the frustration Clyde, I am just an undergrad that is still learning. I was unsure of how to select a specific range for the dataex as the default range was all of the same date.

          As for the data, it came from the USDA database. From there it was exported into and Excel file and then imported into Stata. I also thought it was odd that numeric values were strings.

          As for your question regarding unique identifiers, Region, Variety, Organic, Unit, along with the Date should be unique throughout the whole dataset. (I think this answers your question.)

          Thank you so much for going out of your way to help me out, I really appreciate it. I will work through this and come back with any followup questions I may have - and I will do it correctly next time.

          Comment


          • #6
            Unfortunately, after many changes, I still get the error "repeated time values within panel". If anyone could alert me to why that is still happening I would greatly appreciate it.



            Here is my full code along with a dataex in the following comment below.

            Code:
            *This file runs regressions using USDA data on apple sales. 
            *This .do file uses a .dta file called "full" which can be created from 
            *csv downloads from the USDA website and the ******* do file
            
            clear all
            
            cd "C:\Users\baseb\OneDrive\College\Research Project"
            
            use full
            
            *This is old code, not currently used
            
            *keep if inlist(Unit, "per pound")
            *destring WeightedAvgPrice
            *gen Vorg = real(Organic)
            *gen Vvar = real(Variety)
            
            drop Class
            drop Commodity
            drop MarkedLocal
            
            replace Organic = "N" if missing(Organic)
            
            *destring Date, replace
            *destring NumberofStores, replace
            *destring WeightedAvgPrice, replace
            *destring LowPrice, replace
            *destring HighPrice, replace
            
            
            *dataex
            
            *First we create categorical variables from strings 
            encode Variety, generate(Vvar) 
            
            egen Vorg = group(Organic)
            
            encode Region, generate(Vreg)
            
            encode Unit, generate(Vunit)
            
            replace Vorg=0 if Vorg==.
            
            *Alternative way to encode string variables which creates a separate indicator 
            *variable for each string
            
            *tabulate Variety, generate(apple)
            
            *tabulate Region, generate(region)
            
            
            
            *create a real number variable for weighted average price
            gen WAP = real(WeightedAvgPrice)
            
            
            
            
            
            *adjust the prices for the size of bags
            gen AWAP=WAP/5 if Vunit==3
            
            replace AWAP=WAP/3 if Vunit==2
            
            replace AWAP=WAP/2 if Vunit==1
            
            replace AWAP=WAP if Vunit==4
            
            
            
            
            *regress WAP Vorg i.Vvar
            *regress WAP i.Vvar
            
            *drop if Vorg==1
            
            *this regression works if encoding regions as separate indicator variables
            *regress region4 i.Vvar
            
            regress AWAP i.Vreg i.Vvar
            
            *ib4.Vunit uses per pound bags as the reference unit
            *ib7.Vvar is Honeycrisp
            *ib4.Vreg is 'National'
            regress AWAP Vorg ib7.Vvar ib4.Vunit ib4.Vreg
            
            
            *Convert dates to quarterly variable... see documentation
            
            gen numericdate = date(Date, "MDY")
            gen quart = quarter(numericdate)
            format numericdate %td
            order numericdate, first
            drop Date
            
            *regress including i.quarter (for seasonality) and i.year (for fixed effects)
            regress AWAP Vorg ib7.Vvar ib4.Vunit ib4.Vreg ib1.quart
            
            
            regress AWAP Vorg ib7.Vvar ib4.Vunit ib4.Vreg ib1.quart
            
            
            egen specific = group(Region Variety Unit Organic numericdate)
            
            *xtset specific numericdate
            *I still get "repeated time values within panel here
            
            
            *generate lagged prices (check for missing - drop if missing)
            
            *regress with seasonality, year FE, and weekly lags
            
            
            
            *Why from 2008- Sep 2010 is the only variety observed Red Delicious? 
            *I called and could not get an answer yet.
            *Is there a way to get more specific data on location instead of general regions?

            Comment


            • #7
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input float numericdate str18 Region str21 Variety str1 Organic str10 Environment str9 Unit str5 NumberofStores str17(WeightedAvgPrice LowPrice HighPrice) long Vvar float Vorg long(Vreg Vunit) float(WAP AWAP quart specific)
              21189 "NATIONAL"           "BRAEBURN"              "N" "" "3 lb bag"  "41"   "3.93" ""                  ""      1 1 4 2 3.93      1.31 1 10443
              21189 "NATIONAL"           "BRAEBURN"              "N" "" "5 lb bag"  "17"   "4.99" ""                  ""      1 1 4 3 4.99      .998 1 10597
              21189 "NATIONAL"           "BRAEBURN"              "N" "" "per pound" "744"  "1.26" ""                  ""      1 1 4 4 1.26      1.26 1 10958
              21189 "NATIONAL"           "BRAEBURN"              "Y" "" "2 lb bag"  "109"  "2.97" ""                  ""      1 2 4 1 2.97     1.485 1 10296
              21189 "NATIONAL"           "BRAEBURN"              "Y" "" "per pound" "72"   "1.65" ""                  ""      1 2 4 4 1.65      1.65 1 11220
              21189 "NATIONAL"           "FUJI"                  "N" "" "2 lb bag"  "20"   "2.5"  ""                  ""      2 1 4 1  2.5      1.25 1 11249
              21189 "NATIONAL"           "FUJI"                  "N" "" "3 lb bag"  "498"  "2.66" ""                  ""      2 1 4 2 2.66  .8866667 1 11585
              21189 "NATIONAL"           "FUJI"                  "N" "" "5 lb bag"  "829"  "4.96" ""                  ""      2 1 4 3 4.96      .992 1 11961
              21189 "NATIONAL"           "FUJI"                  "N" "" "per pound" "1442" "1.25" ""                  ""      2 1 4 4 1.25      1.25 1 12351
              21189 "NATIONAL"           "FUJI"                  "Y" "" "2 lb bag"  "320"  "3.46" ""                  ""      2 2 4 1 3.46      1.73 1 11276
              21189 "NATIONAL"           "FUJI"                  "Y" "" "3 lb bag"  "244"  "3.94" ""                  ""      2 2 4 2 3.94 1.3133334 1 11779
              21189 "NATIONAL"           "FUJI"                  "Y" "" "per pound" "1137" "2.22" ""                  ""      2 2 4 4 2.22      2.22 1 12694
              21189 "NATIONAL"           "GALA"                  "N" "" "2 lb bag"  "20"   "2.5"  ""                  ""      3 1 4 1  2.5      1.25 1 12737
              21189 "NATIONAL"           "GALA"                  "N" "" "3 lb bag"  "2271" "1.96" ""                  ""      3 1 4 2 1.96  .6533334 1 13129
              21189 "NATIONAL"           "GALA"                  "N" "" "5 lb bag"  "1018" "4.7"  ""                  ""      3 1 4 3  4.7  .9399999 1 13641
              21189 "NATIONAL"           "GALA"                  "N" "" "per pound" "2893" "1.19" ""                  ""      3 1 4 4 1.19      1.19 1 14038
              21189 "NATIONAL"           "GALA"                  "Y" "" "2 lb bag"  "338"  "3.32" ""                  ""      3 2 4 1 3.32      1.66 1 12763
              21189 "NATIONAL"           "GALA"                  "Y" "" "3 lb bag"  "409"  "3.92" ""                  ""      3 2 4 2 3.92 1.3066667 1 13438
              21189 "NATIONAL"           "GALA"                  "Y" "" "per pound" "1088" "1.87" ""                  ""      3 2 4 4 1.87      1.87 1 14408
              21189 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "3 lb bag"  "409"  "2.75" ""                  ""      5 1 4 2 2.75  .9166667 1 14904
              21189 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "5 lb bag"  "21"   "3.82" ""                  ""      5 1 4 3 3.82      .764 1 15235
              21189 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "per pound" "755"  "1.23" ""                  ""      5 1 4 4 1.23      1.23 1 15615
              21189 "NATIONAL"           "GOLDEN DELICIOUS"      "Y" "" "per pound" "26"   "1.87" ""                  ""      5 2 4 4 1.87      1.87 1 15899
              21189 "NATIONAL"           "GRANNY SMITH"          "N" "" "2 lb bag"  "20"   "2.5"  ""                  ""      6 1 4 1  2.5      1.25 1 15922
              21189 "NATIONAL"           "GRANNY SMITH"          "N" "" "3 lb bag"  "261"  "2.8"  ""                  ""      6 1 4 2  2.8  .9333333 1 16261
              21189 "NATIONAL"           "GRANNY SMITH"          "N" "" "5 lb bag"  "790"  "5"    ""                  ""      6 1 4 3    5         1 1 16588
              21189 "NATIONAL"           "GRANNY SMITH"          "N" "" "per pound" "1643" "1.32" ""                  ""      6 1 4 4 1.32      1.32 1 16959
              21189 "NATIONAL"           "GRANNY SMITH"          "Y" "" "2 lb bag"  "248"  "3.57" ""                  ""      6 2 4 1 3.57     1.785 1 15944
              21189 "NATIONAL"           "GRANNY SMITH"          "Y" "" "3 lb bag"  "52"   "4.99" ""                  ""      6 2 4 2 4.99 1.6633333 1 16431
              21189 "NATIONAL"           "GRANNY SMITH"          "Y" "" "per pound" "52"   "2.33" ""                  ""      6 2 4 4 2.33      2.33 1 17256
              21189 "NATIONAL"           "HONEYCRISP"            "N" "" "3 lb bag"  "10"   "1.99" ""                  ""      7 1 4 2 1.99  .6633334 1 17433
              21189 "NATIONAL"           "HONEYCRISP"            "N" "" "per pound" "8443" "2.34" ""                  ""      7 1 4 4 2.34      2.34 1 17724
              21189 "NATIONAL"           "HONEYCRISP"            "Y" "" "2 lb bag"  "2224" "4.98" ""                  ""      7 2 4 1 4.98      2.49 1 17315
              21189 "NATIONAL"           "HONEYCRISP"            "Y" "" "per pound" "56"   "2.88" ""                  ""      7 2 4 4 2.88      2.88 1 17886
              21189 "NATIONAL"           "JONAGOLD"              "N" "" "3 lb bag"  "36"   "2.5"  ""                  ""      8 1 4 2  2.5  .8333333 1 18019
              21189 "NATIONAL"           "JONAGOLD"              "N" "" "5 lb bag"  "31"   "5.44" ""                  ""      8 1 4 3 5.44     1.088 1 18116
              21189 "NATIONAL"           "JONAGOLD"              "N" "" "per pound" "461"  "1.21" ""                  ""      8 1 4 4 1.21      1.21 1 18358
              21189 "NATIONAL"           "JONAGOLD"              "Y" "" "per pound" "66"   "1.33" ""                  ""      8 2 4 4 1.33      1.33 1 18446
              21189 "NATIONAL"           "JONATHAN"              "N" "" "3 lb bag"  "121"  "2.98" ""                  ""      9 1 4 2 2.98  .9933333 1 18607
              21189 "NATIONAL"           "MCINTOSH"              "N" "" "3 lb bag"  "659"  "2.7"  ""                  ""     10 1 4 2  2.7        .9 1 18993
              21189 "NATIONAL"           "MCINTOSH"              "N" "" "per pound" "175"  "1.04" ""                  ""     10 1 4 4 1.04      1.04 1 19361
              21189 "NATIONAL"           "PINK LADY/CRIPPS PINK" "N" "" "3 lb bag"  "231"  "2.5"  ""                  ""     12 1 4 2  2.5  .8333333 1 19608
              21189 "NATIONAL"           "PINK LADY/CRIPPS PINK" "N" "" "5 lb bag"  "22"   "3.47" ""                  ""     12 1 4 3 3.47      .694 1 19748
              21189 "NATIONAL"           "PINK LADY/CRIPPS PINK" "N" "" "per pound" "2252" "1.65" ""                  ""     12 1 4 4 1.65      1.65 1 20085
              21189 "NATIONAL"           "PINK LADY/CRIPPS PINK" "Y" "" "per pound" "91"   "1.72" ""                  ""     12 2 4 4 1.72      1.72 1 20317
              21189 "NATIONAL"           "RED DELICIOUS"         "N" "" "2 lb bag"  "20"   "2.5"  ""                  ""     13 1 4 1  2.5      1.25 1 20344
              21189 "NATIONAL"           "RED DELICIOUS"         "N" "" "3 lb bag"  "887"  "2.75" ""                  ""     13 1 4 2 2.75  .9166667 1 20742
              21189 "NATIONAL"           "RED DELICIOUS"         "N" "" "5 lb bag"  "319"  "4.68" ""                  ""     13 1 4 3 4.68      .936 1 21274
              21189 "NATIONAL"           "RED DELICIOUS"         "N" "" "per pound" "1919" ".98"  ""                  ""     13 1 4 4  .98       .98 1 21792
              21189 "NATIONAL"           "RED DELICIOUS"         "Y" "" "2 lb bag"  "202"  "3.35" ""                  ""     13 2 4 1 3.35     1.675 1 20364
              21189 "NATIONAL"           "RED DELICIOUS"         "Y" "" "3 lb bag"  "255"  "4.98" ""                  ""     13 2 4 2 4.98      1.66 1 20986
              21189 "NATIONAL"           "RED DELICIOUS"         "Y" "" "per pound" "156"  "1.57" ""                  ""     13 2 4 4 1.57      1.57 1 22139
              21189 "NATIONAL"           "ROME"                  "N" "" "3 lb bag"  "35"   "2.99" ""                  ""     14 1 4 2 2.99  .9966667 1 22268
              21189 "NATIONAL"           "ROME"                  "N" "" "per pound" "5"    "1.99" ""                  ""     14 1 4 4 1.99      1.99 1 22398
              21189 "MIDWEST U.S."       "BRAEBURN"              "N" "" "3 lb bag"  "41"   "3.93" "3.79"              "3.97"  1 1 3 2 3.93      1.31 1  1984
              21189 "MIDWEST U.S."       "BRAEBURN"              "N" "" "5 lb bag"  "17"   "4.99" "4.99"              "4.99"  1 1 3 3 4.99      .998 1  2109
              21189 "MIDWEST U.S."       "BRAEBURN"              "N" "" "per pound" "181"  "1.39" "1.18"              "1.49"  1 1 3 4 1.39      1.39 1  2445
              21189 "MIDWEST U.S."       "BRAEBURN"              "Y" "" "2 lb bag"  "66"   "2.31" "2"                 "3.99"  1 2 3 1 2.31     1.155 1  1874
              21189 "MIDWEST U.S."       "BRAEBURN"              "Y" "" "per pound" "47"   "1.32" ".99"               "2.99"  1 2 3 4 1.32      1.32 1  2604
              21189 "MIDWEST U.S."       "FUJI"                  "N" "" "2 lb bag"  "20"   "2.5"  "2.5"               "2.5"   2 1 3 1  2.5      1.25 1  2619
              21189 "MIDWEST U.S."       "FUJI"                  "N" "" "3 lb bag"  "444"  "2.68" "2.49"              "3.97"  2 1 3 2 2.68  .8933334 1  2856
              21189 "MIDWEST U.S."       "FUJI"                  "N" "" "5 lb bag"  "17"   "4.99" "4.99"              "4.99"  2 1 3 3 4.99      .998 1  3027
              21189 "MIDWEST U.S."       "FUJI"                  "N" "" "per pound" "166"  "1.29" ".6899999999999999" "1.69"  2 1 3 4 1.29      1.29 1  3378
              21189 "MIDWEST U.S."       "FUJI"                  "Y" "" "2 lb bag"  "130"  "3.04" "2.99"              "3.99"  2 2 3 1 3.04      1.52 1  2632
              21189 "MIDWEST U.S."       "FUJI"                  "Y" "" "3 lb bag"  "231"  "3.99" "3.99"              "3.99"  2 2 3 2 3.99      1.33 1  2932
              21189 "MIDWEST U.S."       "FUJI"                  "Y" "" "per pound" "45"   "2.48" ".99"               "2.99"  2 2 3 4 2.48      2.48 1  3601
              21189 "MIDWEST U.S."       "GALA"                  "N" "" "2 lb bag"  "20"   "2.5"  "2.5"               "2.5"   3 1 3 1  2.5      1.25 1  3631
              21189 "MIDWEST U.S."       "GALA"                  "N" "" "3 lb bag"  "1168" "2.15" "1.69"              "3.49"  3 1 3 2 2.15  .7166667 1  3948
              21189 "MIDWEST U.S."       "GALA"                  "N" "" "5 lb bag"  "31"   "4.09" "2.99"              "4.99"  3 1 3 3 4.09      .818 1  4288
              21189 "MIDWEST U.S."       "GALA"                  "N" "" "per pound" "286"  "1.34" ".79"               "1.49"  3 1 3 4 1.34      1.34 1  4648
              21189 "MIDWEST U.S."       "GALA"                  "Y" "" "2 lb bag"  "201"  "2.77" "1.99"              "3.99"  3 2 3 1 2.77     1.385 1  3645
              21189 "MIDWEST U.S."       "GALA"                  "Y" "" "3 lb bag"  "263"  "3.93" "2.99"              "3.99"  3 2 3 2 3.93      1.31 1  4170
              21189 "MIDWEST U.S."       "GALA"                  "Y" "" "per pound" "111"  "2.23" "1.69"              "2.99"  3 2 3 4 2.23      2.23 1  4945
              21189 "MIDWEST U.S."       "GOLDEN DELICIOUS"      "N" "" "3 lb bag"  "313"  "2.73" ".99"               "2.99"  5 1 3 2 2.73       .91 1  5301
              21189 "MIDWEST U.S."       "GOLDEN DELICIOUS"      "N" "" "per pound" "168"  "1.32" ".59"               "1.49"  5 1 3 4 1.32      1.32 1  5862
              21189 "MIDWEST U.S."       "GOLDEN DELICIOUS"      "Y" "" "per pound" "10"   "1.69" "1.69"              "1.69"  5 2 3 4 1.69      1.69 1  5996
              21189 "MIDWEST U.S."       "GRANNY SMITH"          "N" "" "2 lb bag"  "20"   "2.5"  "2.5"               "2.5"   6 1 3 1  2.5      1.25 1  6012
              21189 "MIDWEST U.S."       "GRANNY SMITH"          "N" "" "3 lb bag"  "191"  "3.24" "2.88"              "3.99"  6 1 3 2 3.24      1.08 1  6233
              21189 "MIDWEST U.S."       "GRANNY SMITH"          "N" "" "per pound" "64"   "1.36" ".99"               "1.49"  6 1 3 4 1.36      1.36 1  6703
              21189 "MIDWEST U.S."       "GRANNY SMITH"          "Y" "" "2 lb bag"  "130"  "3.04" "2.99"              "3.99"  6 2 3 1 3.04      1.52 1  6022
              21189 "MIDWEST U.S."       "GRANNY SMITH"          "Y" "" "per pound" "10"   "1.69" "1.69"              "1.69"  6 2 3 4 1.69      1.69 1  6848
              21189 "MIDWEST U.S."       "HONEYCRISP"            "N" "" "per pound" "1606" "2.21" ".79"               "2.99"  7 1 3 4 2.21      2.21 1  7228
              21189 "MIDWEST U.S."       "HONEYCRISP"            "Y" "" "2 lb bag"  "680"  "4.94" "1.99"              "4.99"  7 2 3 1 4.94      2.47 1  6880
              21189 "MIDWEST U.S."       "HONEYCRISP"            "Y" "" "per pound" "10"   "3.49" "3.49"              "3.49"  7 2 3 4 3.49      3.49 1  7352
              21189 "MIDWEST U.S."       "JONAGOLD"              "N" "" "3 lb bag"  "36"   "2.5"  "2.5"               "2.5"   8 1 3 2  2.5  .8333333 1  7452
              21189 "MIDWEST U.S."       "JONAGOLD"              "N" "" "5 lb bag"  "31"   "5.44" "4.99"              "5.99"  8 1 3 3 5.44     1.088 1  7509
              21189 "MIDWEST U.S."       "JONAGOLD"              "N" "" "per pound" "45"   "1.49" "1.49"              "1.49"  8 1 3 4 1.49      1.49 1  7700
              21189 "MIDWEST U.S."       "JONAGOLD"              "Y" "" "per pound" "42"   "1.12" ".99"               "1.88"  8 2 3 4 1.12      1.12 1  7731
              21189 "MIDWEST U.S."       "JONATHAN"              "N" "" "3 lb bag"  "30"   "2.94" "2.5"               "3.79"  9 1 3 2 2.94       .98 1  7884
              21189 "MIDWEST U.S."       "MCINTOSH"              "N" "" "3 lb bag"  "531"  "2.64" "2.5"               "2.99" 10 1 3 2 2.64  .8800001 1  8162
              21189 "MIDWEST U.S."       "MCINTOSH"              "N" "" "per pound" "136"  ".97"  ".79"               ".99"  10 1 3 4  .97       .97 1  8357
              21189 "MIDWEST U.S."       "PINK LADY/CRIPPS PINK" "N" "" "3 lb bag"  "231"  "2.5"  "2.5"               "2.5"  12 1 3 2  2.5  .8333333 1  8506
              21189 "MIDWEST U.S."       "PINK LADY/CRIPPS PINK" "N" "" "per pound" "458"  "1.79" ".79"               "1.99" 12 1 3 4 1.79      1.79 1  8842
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "N" "" "2 lb bag"  "20"   "2.5"  "2.5"               "2.5"  13 1 3 1  2.5      1.25 1  8952
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "N" "" "3 lb bag"  "502"  "2.69" ".99"               "3.97" 13 1 3 2 2.69  .8966667 1  9265
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "N" "" "5 lb bag"  "26"   "4.3"  "2.99"              "4.99" 13 1 3 3  4.3       .86 1  9574
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "N" "" "per pound" "285"  ".77"  ".58"               "1.49" 13 1 3 4  .77       .77 1 10044
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "Y" "" "2 lb bag"  "146"  "3.11" "2.99"              "3.99" 13 2 3 1 3.11     1.555 1  8959
              21189 "MIDWEST U.S."       "RED DELICIOUS"         "Y" "" "per pound" "46"   "1.14" ".99"               "1.69" 13 2 3 4 1.14      1.14 1 10219
              21189 "SOUTH CENTRAL U.S." "BRAEBURN"              "N" "" "per pound" "157"  "1.12" ".79"               "1.29"  1 1 6 4 1.12      1.12 1 26889
              21189 "SOUTH CENTRAL U.S." "FUJI"                  "N" "" "3 lb bag"  "10"   "1.99" "1.99"              "1.99"  2 1 6 2 1.99  .6633334 1 27186
              21189 "SOUTH CENTRAL U.S." "FUJI"                  "N" "" "per pound" "286"  "1.27" ".79"               "1.79"  2 1 6 4 1.27      1.27 1 27626
              21189 "SOUTH CENTRAL U.S." "FUJI"                  "Y" "" "2 lb bag"  "147"  "3.69" "3.5"               "3.99"  2 2 6 1 3.69     1.845 1 27009
              21189 "SOUTH CENTRAL U.S." "FUJI"                  "Y" "" "per pound" "154"  "2"    "1.78"              "2.99"  2 2 6 4    2         2 1 27868
              21189 "SOUTH CENTRAL U.S." "GALA"                  "N" "" "3 lb bag"  "330"  "2.15" "1.69"              "3.69"  3 1 6 2 2.15  .7166667 1 28182
              21189 "SOUTH CENTRAL U.S." "GALA"                  "N" "" "per pound" "391"  "1.18" ".79"               "1.79"  3 1 6 4 1.18      1.18 1 28715
              21189 "SOUTH CENTRAL U.S." "GALA"                  "Y" "" "2 lb bag"  "75"   "3.99" "3.98"              "3.99"  3 2 6 1 3.99     1.995 1 27908
              21189 "SOUTH CENTRAL U.S." "GALA"                  "Y" "" "per pound" "241"  "1.81" "1.48"              "2.99"  3 2 6 4 1.81      1.81 1 28996
              21189 "SOUTH CENTRAL U.S." "GRANNY SMITH"          "N" "" "per pound" "64"   "1.75" "1.49"              "1.79"  6 1 6 4 1.75      1.75 1 30290
              21189 "SOUTH CENTRAL U.S." "GRANNY SMITH"          "Y" "" "2 lb bag"  "56"   "3.99" "3.99"              "3.99"  6 2 6 1 3.99     1.995 1 29724
              21189 "SOUTH CENTRAL U.S." "HONEYCRISP"            "N" "" "3 lb bag"  "10"   "1.99" "1.99"              "1.99"  7 1 6 2 1.99  .6633334 1 30499
              21189 "SOUTH CENTRAL U.S." "HONEYCRISP"            "N" "" "per pound" "1711" "2.44" ".98"               "2.99"  7 1 6 4 2.44      2.44 1 30691
              21189 "SOUTH CENTRAL U.S." "HONEYCRISP"            "Y" "" "2 lb bag"  "396"  "4.99" "4.99"              "4.99"  7 2 6 1 4.99     2.495 1 30453
              21189 "SOUTH CENTRAL U.S." "JONAGOLD"              "N" "" "per pound" "185"  "1.3"  "1.29"              "1.49"  8 1 6 4  1.3       1.3 1 31053
              21189 "SOUTH CENTRAL U.S." "JONATHAN"              "N" "" "3 lb bag"  "74"   "2.99" "2.99"              "2.99"  9 1 6 2 2.99  .9966667 1 31190
              21189 "SOUTH CENTRAL U.S." "MCINTOSH"              "N" "" "3 lb bag"  "92"   "2.99" "2.99"              "2.99" 10 1 6 2 2.99  .9966667 1 31336
              21189 "SOUTH CENTRAL U.S." "PINK LADY/CRIPPS PINK" "N" "" "per pound" "301"  "1.34" ".79"               "1.99" 12 1 6 4 1.34      1.34 1 31664
              21189 "SOUTH CENTRAL U.S." "RED DELICIOUS"         "N" "" "3 lb bag"  "126"  "3.04" "1.99"              "3.69" 13 1 6 2 3.04 1.0133333 1 32070
              21189 "SOUTH CENTRAL U.S." "RED DELICIOUS"         "N" "" "per pound" "390"  ".84"  ".58"               "1.49" 13 1 6 4  .84       .84 1 32779
              21189 "SOUTH CENTRAL U.S." "RED DELICIOUS"         "Y" "" "2 lb bag"  "56"   "3.99" "3.99"              "3.99" 13 2 6 1 3.99     1.995 1 31774
              21189 "SOUTHWEST U.S."     "BRAEBURN"              "N" "" "per pound" "267"  "1.09" ".98"               "1.59"  1 1 7 4 1.09      1.09 1 33301
              21189 "SOUTHWEST U.S."     "BRAEBURN"              "Y" "" "2 lb bag"  "15"   "3.99" "3.99"              "3.99"  1 2 7 1 3.99     1.995 1 33024
              21189 "SOUTHWEST U.S."     "FUJI"                  "N" "" "3 lb bag"  "25"   "2.49" "2.49"              "2.49"  2 1 7 2 2.49       .83 1 33622
              21189 "SOUTHWEST U.S."     "FUJI"                  "N" "" "per pound" "455"  ".92"  ".34"               "1.99"  2 1 7 4  .92       .92 1 34128
              21189 "SOUTHWEST U.S."     "FUJI"                  "Y" "" "2 lb bag"  "15"   "3.99" "3.99"              "3.99"  2 2 7 1 3.99     1.995 1 33460
              21189 "SOUTHWEST U.S."     "FUJI"                  "Y" "" "3 lb bag"  "13"   "2.99" "2.99"              "2.99"  2 2 7 2 2.99  .9966667 1 33712
              21189 "SOUTHWEST U.S."     "FUJI"                  "Y" "" "per pound" "287"  "2.2"  "1.5"               "2.99"  2 2 7 4  2.2       2.2 1 34416
              21189 "SOUTHWEST U.S."     "GALA"                  "N" "" "3 lb bag"  "118"  ".99"  ".99"               ".99"   3 1 7 2  .99       .33 1 34636
              21189 "SOUTHWEST U.S."     "GALA"                  "N" "" "5 lb bag"  "122"  "2.77" "2.77"              "2.77"  3 1 7 3 2.77      .554 1 34815
              21189 "SOUTHWEST U.S."     "GALA"                  "N" "" "per pound" "1187" "1.07" ".49"               "1.99"  3 1 7 4 1.07      1.07 1 35170
              21189 "SOUTHWEST U.S."     "GALA"                  "Y" "" "2 lb bag"  "15"   "3.99" "3.99"              "3.99"  3 2 7 1 3.99     1.995 1 34455
              21189 "SOUTHWEST U.S."     "GALA"                  "Y" "" "3 lb bag"  "13"   "2.99" "2.99"              "2.99"  3 2 7 2 2.99  .9966667 1 34743
              21189 "SOUTHWEST U.S."     "GALA"                  "Y" "" "per pound" "564"  "1.55" ".88"               "2.99"  3 2 7 4 1.55      1.55 1 35471
              21189 "SOUTHWEST U.S."     "GOLDEN DELICIOUS"      "N" "" "3 lb bag"  "6"    ".99"  ".99"               ".99"   5 1 7 2  .99       .33 1 35552
              21189 "SOUTHWEST U.S."     "GOLDEN DELICIOUS"      "N" "" "per pound" "175"  ".98"  ".34"               "1.59"  5 1 7 4  .98       .98 1 35874
              21189 "SOUTHWEST U.S."     "GOLDEN DELICIOUS"      "Y" "" "per pound" "8"    "1.99" "1.99"              "1.99"  5 2 7 4 1.99      1.99 1 35964
              21189 "SOUTHWEST U.S."     "GRANNY SMITH"          "N" "" "3 lb bag"  "45"   ".99"  ".99"               ".99"   6 1 7 2  .99       .33 1 36102
              21189 "SOUTHWEST U.S."     "GRANNY SMITH"          "N" "" "per pound" "265"  "1.17" ".5"                "1.99"  6 1 7 4 1.17      1.17 1 36481
              21189 "SOUTHWEST U.S."     "GRANNY SMITH"          "Y" "" "2 lb bag"  "15"   "3.99" "3.99"              "3.99"  6 2 7 1 3.99     1.995 1 35976
              21189 "SOUTHWEST U.S."     "HONEYCRISP"            "N" "" "per pound" "902"  "2.1"  ".49"               "2.99"  7 1 7 4  2.1       2.1 1 36865
              21189 "SOUTHWEST U.S."     "HONEYCRISP"            "Y" "" "2 lb bag"  "541"  "4.99" "4.99"              "4.99"  7 2 7 1 4.99     2.495 1 36673
              21189 "SOUTHWEST U.S."     "JONAGOLD"              "N" "" "per pound" "112"  "1.18" ".5"                "1.59"  8 1 7 4 1.18      1.18 1 37121
              21189 "SOUTHWEST U.S."     "PINK LADY/CRIPPS PINK" "N" "" "per pound" "306"  "1.11" ".79"               "1.49" 12 1 7 4 1.11      1.11 1 37466
              21189 "SOUTHWEST U.S."     "RED DELICIOUS"         "N" "" "per pound" "436"  ".88"  ".33"               "1.59" 13 1 7 4  .88       .88 1 38264
              21189 "SOUTHWEST U.S."     "RED DELICIOUS"         "Y" "" "per pound" "8"    "1.99" "1.99"              "1.99" 13 2 7 4 1.99      1.99 1 38463
              21189 "NORTHWEST U.S."     "BRAEBURN"              "N" "" "per pound" "80"   "1.04" ".89"               "1.29"  1 1 5 4 1.04      1.04 1 22700
              21189 "NORTHWEST U.S."     "BRAEBURN"              "Y" "" "2 lb bag"  "28"   "3.99" "3.99"              "3.99"  1 2 5 1 3.99     1.995 1 22410
              21189 "NORTHWEST U.S."     "FUJI"                  "N" "" "3 lb bag"  "13"   "2.98" "2.98"              "2.98"  2 1 5 2 2.98  .9933333 1 22925
              21189 "NORTHWEST U.S."     "FUJI"                  "N" "" "5 lb bag"  "22"   "3.47" "3.47"              "3.47"  2 1 5 3 3.47      .694 1 23030
              21189 "NORTHWEST U.S."     "FUJI"                  "N" "" "per pound" "112"  "1.19" ".79"               "3"     2 1 5 4 1.19      1.19 1 23357
              21189 "NORTHWEST U.S."     "FUJI"                  "Y" "" "2 lb bag"  "28"   "3.99" "3.99"              "3.99"  2 2 5 1 3.99     1.995 1 22849
              21189 "NORTHWEST U.S."     "FUJI"                  "Y" "" "per pound" "130"  "1.56" ".99"               "1.99"  2 2 5 4 1.56      1.56 1 23625
              21189 "NORTHWEST U.S."     "GALA"                  "N" "" "3 lb bag"  "13"   "2.98" "2.98"              "2.98"  3 1 5 2 2.98  .9933333 1 23753
              21189 "NORTHWEST U.S."     "GALA"                  "N" "" "per pound" "187"  "1.19" ".88"               "3"     3 1 5 4 1.19      1.19 1 24155
              21189 "NORTHWEST U.S."     "GALA"                  "Y" "" "2 lb bag"  "28"   "3.99" "3.99"              "3.99"  3 2 5 1 3.99     1.995 1 23654
              21189 "NORTHWEST U.S."     "GALA"                  "Y" "" "per pound" "2"    "1.48" "1.48"              "1.48"  3 2 5 4 1.48      1.48 1 24408
              21189 "NORTHWEST U.S."     "GRANNY SMITH"          "N" "" "3 lb bag"  "13"   "2.98" "2.98"              "2.98"  6 1 5 2 2.98  .9933333 1 24757
              21189 "NORTHWEST U.S."     "GRANNY SMITH"          "N" "" "per pound" "15"   "3"    "3"                 "3"     6 1 5 4    3         3 1 25063
              21189 "NORTHWEST U.S."     "GRANNY SMITH"          "Y" "" "2 lb bag"  "28"   "3.99" "3.99"              "3.99"  6 2 5 1 3.99     1.995 1 24686
              21189 "NORTHWEST U.S."     "HONEYCRISP"            "N" "" "per pound" "419"  "2.1"  ".98"               "2.99"  7 1 5 4  2.1       2.1 1 25393
              21189 "NORTHWEST U.S."     "HONEYCRISP"            "Y" "" "2 lb bag"  "204"  "4.99" "4.99"              "4.99"  7 2 5 1 4.99     2.495 1 25194
              21189 "NORTHWEST U.S."     "HONEYCRISP"            "Y" "" "per pound" "21"   "1.87" "1.69"              "2.98"  7 2 5 4 1.87      1.87 1 25502
              21189 "NORTHWEST U.S."     "JONAGOLD"              "N" "" "per pound" "119"  "1"    ".88"               "1.29"  8 1 5 4    1         1 1 25667
              21189 "NORTHWEST U.S."     "JONAGOLD"              "Y" "" "per pound" "15"   "1.59" "1.59"              "1.59"  8 2 5 4 1.59      1.59 1 25713
              21189 "NORTHWEST U.S."     "PINK LADY/CRIPPS PINK" "N" "" "5 lb bag"  "22"   "3.47" "3.47"              "3.47" 12 1 5 3 3.47      .694 1 25784
              21189 "NORTHWEST U.S."     "PINK LADY/CRIPPS PINK" "Y" "" "per pound" "65"   "1.49" "1.49"              "1.49" 12 2 5 4 1.49      1.49 1 26080
              21189 "NORTHWEST U.S."     "RED DELICIOUS"         "N" "" "per pound" "21"   "2.39" ".88"               "3"    13 1 5 4 2.39      2.39 1 26521
              21189 "HAWAII"             "BRAEBURN"              "N" "" "per pound" "6"    "1.79" "1.79"              "1.79"  1 1 2 4 1.79      1.79 1  1167
              21189 "ALASKA"             "BRAEBURN"              "N" "" "per pound" "46"   "2.49" ".99"               "2.99"  1 1 1 4 2.49      2.49 1    69
              21189 "HAWAII"             "FUJI"                  "N" "" "per pound" "7"    ".99"  ".99"               ".99"   2 1 2 4  .99       .99 1  1391
              21189 "ALASKA"             "FUJI"                  "N" "" "per pound" "33"   "2.99" "2.99"              "2.99"  2 1 1 4 2.99      2.99 1   252
              21189 "ALASKA"             "GALA"                  "N" "" "per pound" "61"   "2.53" "1.89"              "2.99"  3 1 1 4 2.53      2.53 1   492
              21189 "HAWAII"             "GALA"                  "N" "" "per pound" "4"    "1.59" "1.59"              "1.59"  3 1 2 4 1.59      1.59 1  1606
              21189 "HAWAII"             "GRANNY SMITH"          "N" "" "per pound" "6"    "1.99" "1.99"              "1.99"  6 1 2 4 1.99      1.99 1  1721
              21189 "ALASKA"             "HONEYCRISP"            "N" "" "per pound" "21"   "2.46" "1.99"              "2.97"  7 1 1 4 2.46      2.46 1   827
              21189 "ALASKA"             "HONEYCRISP"            "Y" "" "2 lb bag"  "11"   "5.49" "5.49"              "5.49"  7 2 1 1 5.49     2.745 1   748
              21189 "HAWAII"             "RED DELICIOUS"         "N" "" "3 lb bag"  "6"    "3.69" "3.69"              "3.69" 13 1 2 2 3.69      1.23 1  1839
              21196 "NATIONAL"           "BRAEBURN"              "N" "" "3 lb bag"  "33"   "3.97" ""                  ""      1 1 4 2 3.97 1.3233334 1 10444
              21196 "NATIONAL"           "BRAEBURN"              "N" "" "5 lb bag"  "10"   "4.99" ""                  ""      1 1 4 3 4.99      .998 1 10598
              21196 "NATIONAL"           "BRAEBURN"              "N" "" "per pound" "746"  "1.18" ""                  ""      1 1 4 4 1.18      1.18 1 10959
              21196 "NATIONAL"           "BRAEBURN"              "Y" "" "2 lb bag"  "60"   "2.36" ""                  ""      1 2 4 1 2.36      1.18 1 10297
              21196 "NATIONAL"           "BRAEBURN"              "Y" "" "per pound" "1019" "2.61" ""                  ""      1 2 4 4 2.61      2.61 1 11221
              21196 "NATIONAL"           "FUJI"                  "N" "" "3 lb bag"  "258"  "2.65" ""                  ""      2 1 4 2 2.65  .8833334 1 11586
              21196 "NATIONAL"           "FUJI"                  "N" "" "5 lb bag"  "10"   "4.99" ""                  ""      2 1 4 3 4.99      .998 1 11962
              21196 "NATIONAL"           "FUJI"                  "N" "" "per pound" "3402" "1.35" ""                  ""      2 1 4 4 1.35      1.35 1 12352
              21196 "NATIONAL"           "FUJI"                  "Y" "" "2 lb bag"  "131"  "3"    ""                  ""      2 2 4 1    3       1.5 1 11277
              21196 "NATIONAL"           "FUJI"                  "Y" "" "3 lb bag"  "272"  "4.59" ""                  ""      2 2 4 2 4.59      1.53 1 11780
              21196 "NATIONAL"           "FUJI"                  "Y" "" "per pound" "2676" "2.3"  ""                  ""      2 2 4 4  2.3       2.3 1 12695
              21196 "NATIONAL"           "GALA"                  "N" "" "2 lb bag"  "71"   "2"    ""                  ""      3 1 4 1    2         1 1 12738
              21196 "NATIONAL"           "GALA"                  "N" "" "3 lb bag"  "3277" "2.82" ""                  ""      3 1 4 2 2.82       .94 1 13130
              21196 "NATIONAL"           "GALA"                  "N" "" "5 lb bag"  "10"   "4.99" ""                  ""      3 1 4 3 4.99      .998 1 13642
              21196 "NATIONAL"           "GALA"                  "N" "" "per pound" "4749" "1.33" ""                  ""      3 1 4 4 1.33      1.33 1 14039
              21196 "NATIONAL"           "GALA"                  "Y" "" "2 lb bag"  "2596" "3.24" ""                  ""      3 2 4 1 3.24      1.62 1 12764
              21196 "NATIONAL"           "GALA"                  "Y" "" "3 lb bag"  "173"  "4.61" ""                  ""      3 2 4 2 4.61 1.5366668 1 13439
              21196 "NATIONAL"           "GALA"                  "Y" "" "per pound" "3126" "2.21" ""                  ""      3 2 4 4 2.21      2.21 1 14409
              21196 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "3 lb bag"  "1776" "2.57" ""                  ""      5 1 4 2 2.57  .8566666 1 14905
              21196 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "5 lb bag"  "14"   "3.98" ""                  ""      5 1 4 3 3.98      .796 1 15236
              21196 "NATIONAL"           "GOLDEN DELICIOUS"      "N" "" "per pound" "1332" "1.11" ""                  ""      5 1 4 4 1.11      1.11 1 15616
              21196 "NATIONAL"           "GOLDEN DELICIOUS"      "Y" "" "2 lb bag"  "89"   "3.95" ""                  ""      5 2 4 1 3.95     1.975 1 14570
              21196 "NATIONAL"           "GOLDEN DELICIOUS"      "Y" "" "3 lb bag"  "45"   "3.99" ""                  ""      5 2 4 2 3.99      1.33 1 15044
              end
              format %td numericdate
              label values Vvar Vvar
              label def Vvar 1 "BRAEBURN", modify
              label def Vvar 2 "FUJI", modify
              label def Vvar 3 "GALA", modify
              label def Vvar 5 "GOLDEN DELICIOUS", modify
              label def Vvar 6 "GRANNY SMITH", modify
              label def Vvar 7 "HONEYCRISP", modify
              label def Vvar 8 "JONAGOLD", modify
              label def Vvar 9 "JONATHAN", modify
              label def Vvar 10 "MCINTOSH", modify
              label def Vvar 12 "PINK LADY/CRIPPS PINK", modify
              label def Vvar 13 "RED DELICIOUS", modify
              label def Vvar 14 "ROME", modify
              label values Vreg Vreg
              label def Vreg 1 "ALASKA", modify
              label def Vreg 2 "HAWAII", modify
              label def Vreg 3 "MIDWEST U.S.", modify
              label def Vreg 4 "NATIONAL", modify
              label def Vreg 5 "NORTHWEST U.S.", modify
              label def Vreg 6 "SOUTH CENTRAL U.S.", modify
              label def Vreg 7 "SOUTHWEST U.S.", modify
              label values Vunit Vunit
              label def Vunit 1 "2 lb bag", modify
              label def Vunit 2 "3 lb bag", modify
              label def Vunit 3 "5 lb bag", modify
              label def Vunit 4 "per pound", modify

              Comment


              • #8
                Unfortunately, your example data does not demonstrate the problem. When I run -xtset specific numericdate- with the data given in #7 it produces no error messages and runs just fine. However, your code for defining the variable specific is incorrect: numericdate must not be included there, because numericdate has to be indicated separately in the -xtset- command if you need to use lag operators.

                So I can't give you specific help here. But here's a general approach to resolving the problem. The requirement is that the combination of specific and numericdate uniquely identify observations in your full data set. The error message you are getting from -xtset- says that this requirement fails in your data. I have never known Stata to be wrong about this. So despite your expectation that the combination of Region Variety Unit Organic and Date uniquely identifies observations in your data, this is not actually the case.

                To identify the offending observations, run:

                Code:
                duplicates tag Region Variety Unit Organic numericdate, gen(flag)
                browse if flag
                and Stata will show them to you. You will then be faced with one of two possibilities. It may be that there is a problem with the data that you will have to fix to remove or combine offending observations so that you are left with data that meets the requirements for -xtset specific numericdate-. The other possibility is that you will recognize that some additional variable needs to be included along with Region Variety Unit and Organic in the definition of specific to distinguish these duplicates and leave you with uniquely identified observations once numericdate is taken into account.

                Comment


                • #9
                  Clyde,

                  That code allowed me to find the data causing the issues, allowing me to add NumberofStores to the specific list which then allowed me to use xtset.
                  Thank you so much for the help. I will return with other questions if necessary.

                  Comment

                  Working...
                  X