Announcement

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

  • Error en la ejecucion de comandos

    Saludos me podrian ayudar con este error
    bys id_hogar: egen numpers= count(id_per)
    type mismatch
    r(109);

    .
    .
    .
    . ***Dependencia económica

    .
    . gen depec=1 if ((numpers/numper_ocu_)>3 & numper_ocu_>0 & escjefe==1)
    numpers not found
    r(111);

    .
    . replace depec=1 if (numper_ocu_==0 & escjefe==1)
    variable depec not found
    r(111);

    .
    . replace depec=0 if depec !=1
    variable depec not found
    r(111);

  • #2
    I can understand what you are asking, even though I don't speak your language. I hope you can understand my response in English.

    The "type mismatch" error message is because id_per is a string variable in your data set. You need to create a numeric equivalent of id_per:
    Code:
    egen n_id_per = group(id_per)
    bys id_hogar: egen numpers= count(id_per)
    Once you fix that, the other error messages will go away without any additional changes.

    Comment


    • #3
      Feeding a string variable to egen, count() is not a problem, at least in Stata 18, so unlike Clyde Schechter for once, I don't understand why that error message arises.

      What version of Stata are you using?

      Comment

      Working...
      X