Announcement

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

  • Trouble with scalar drop_all

    Hi,

    Can someone tell how to drop scalars?
    I've tried:
    Code:
    scalar drop _all
    but it's not working.

    Thanks

  • #2
    What you have shown does not have syntactical problems, so there must be something else going on. Without any context for your problem, for others to guess t. Item 12 of the FAQ would be helpful to you in posing your question.

    Comment


    • #3
      Sorry... Here are some details with the code and results.

      After -sts test, wilcoxon- I saved chi2, df, and p in scalars which I can show with ereturn list to copy and paste them in excel.
      I have other variables that I would like to use in the same way but I wanted to drop the previous chi2, df and p with scalar drop _all but I still have the statistics from the previous test.


      Code:
      sts  test Secteurs,wilcoxon
      ...output ommited
      
      estadd scalar chi2Secteurs = r(chi2), replace
      added scalar:
             e(chi2Secteurs) =  64.57887
      estadd scalar dfSecteurs = r(df), replace
      
      added scalar:
               e(dfSecteurs) =  3
      estadd scalar pSecteurs=( chi2tail(r(df), r(chi2))), replace
      
      added scalar:
                e(pSecteurs) =  6.172e-14
      
      
      ereturn list
      
      scalars:
             e(chi2Secteurs) =  64.57886981891892
               e(dfSecteurs) =  3
                e(pSecteurs) =  6.17216083883e-14
      
      scalar drop _all
      
       
      sts  test Sexe,wilcoxon
      
      estadd scalar chi2Sexe = r(chi2), replace
      ...
      
      ereturn list
      
      scalars:
             e(chi2Secteurs) =  64.57886981891892
               e(dfSecteurs) =  3
                e(pSecteurs) =  6.17216083883e-14
                 e(chi2Sexe) =  19.54577121176661
                   e(dfSexe) =  1
                    e(pSexe) =  9.82179101923e-06



      Comment


      • #4
        The "scalars" you see in -ereturn list- are "virtual" scalars that are not effected by the -scalar drop- command. They persist until the next estimation command overwrites them with something else, or until you use the command -estimates drop-.

        Clarification: all of the results of an estimation command that are stored in e() persist, collectively, until the next estimation command writes a new set of return values. If a particular estimation command returns e(this), and there is no such return value from the next estimation command, e(this) will, nevertheless, vanish with the next estimation command.
        Last edited by Clyde Schechter; 15 Jun 2016, 08:51.

        Comment


        • #5
          Thanks Clyde,
          I tried estimate drop _all but they still persist.

          Comment


          • #6
            Sorry, my mistake. It's -ereturn clear-, not -estimates drop-.

            Comment


            • #7
              Don't be sorry. It works fine. Thanks a lot Clyde.
              God bless.

              Comment

              Working...
              X