Announcement

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

  • Strange errors about missing variables with threshold command

    Hi all,

    I am receiving strange error messages about missing variables when running the threshold command. Two examples are:

    Code:
    variable siffra not found
    or
    Code:
    variable __00001H not found
    Neither of these variables are specified in my command or available in the used data set.

    Unfortunately, I have a hard time creating a reproducible example as, for example, in the following code, the threshold command runs without error:

    Code:
    clear
    
    input str25 country int year float trust_most
    "ARGENTINA" 1984 .2607261
    "ARGENTINA" 1991 .2330905
    "ARGENTINA" 1995 .1827731
    "ARGENTINA" 1999 .1587811
    "ARGENTINA" 2006 .1688708
    "ARGENTINA" 2013 .2350472
    "ARGENTINA" 2017 .207304
    "ARMENIA" 1997 .2427184
    "ARMENIA" 2008 .2046477
    "ARMENIA" 2011 .0908174
    "ARMENIA" 2018 .2547236
    "ARMENIA" 2021 .0780018
    "AUSTRIA" 1990 .3184615
    "AUSTRIA" 1999 .3342756
    "AUSTRIA" 2008 .3643755
    "AUSTRIA" 2018 .4894811
    "AUSTRALIA" 1981 .4874776
    "AUSTRALIA" 1995 .4018568
    "AUSTRALIA" 2005 .480949
    "AUSTRALIA" 2012 .5461432
    "AUSTRALIA" 2018 .5419474
    end
    
    threshold trust_most, threshvar(year)
    But if I run the following, with exactly the same data set:

    Code:
    use "/Users/MG/Dropbox/TimeUse/Data/WVS/Trust.dta", clear
    keep country year trust_most
    keep if country=="ARGENTINA" | country=="AUSTRALIA"  | country=="ARMENIA" | country=="AUSTRIA"
    threshold trust_most, threshvar(year)
    Click image for larger version

Name:	Screenshot 2024-07-05 at 14.09.27.png
Views:	1
Size:	776.2 KB
ID:	1757902

    I am getting the
    Code:
    variable siffra not found
    message.

    I have run
    Code:
    update all
    in the hope that this will solve the issue, but the issue persists. (I am using Stata/SE 17.0)
    Thank you for your help.
    Last edited by Gabor Mugge; 05 Jul 2024, 07:10.

  • #2
    Please find an example data set attached here. With this I wasn't able to run the
    Code:
    use "/Users/MG/Downloads/Trust_seg.dta", clear 
    threshold trust_most, threshvar(year)
    command.
    Attached Files

    Comment


    • #3
      The dataset seems to have previously been set to use siffra as a panel variable. Try typing

      Code:
      char list
      and you'll see, amongst other things:

      Code:
      _dta[_TSpanel]:             siffra
      _dta[_TSitrvl]:             1
      _dta[tis]:                  year
      _dta[iis]:                  siffra
      The threshold command is picking this up and looking for a variable called siffra. The command should work once you do

      Code:
      tsset, clear

      Comment


      • #4
        Thanks a lot! This solved the issue.

        Comment

        Working...
        X