Announcement

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

  • RDDENSITY (graph_options not allowed)

    hi, everyone, I'm using Stata to learning RDD(I'm a new learner), I received the error below when I have a try to use RDDENSITY(I already install it), I wonder how to deal with it?

    option graph_options() not allowed r(198);

    and the following is my code:

    #delimit ; cap drop temp_*;
    rddensity cut, plot plot_range(-40 40)
    fitselect(restricted) genvars(temp)
    graph_options(title("RDDENSITY PLOT: Housing Data") xtitle("area-90") xlabel(-20(5)20) legend(off));
    #d cr
    graph export "Fig_2.png", replace
    Last edited by Du RuiXue; 15 Jun 2021, 19:47.

  • #2
    Try

    Code:
    rddensity cut, plot plot_range(-40 40)
    fitselect(restricted) genvars(temp)
    title("RDDENSITY PLOT: Housing Data") xtitle("area-90") xlabel(-20(5)20) legend(off);

    Comment


    • #3
      Thank you so much. I had a try just now, it worked. But, could you tell me why I can not use the code "graph_options" here? Is there something wrong with my download package rddensity?

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Try

        Code:
        rddensity cut, plot plot_range(-40 40)
        fitselect(restricted) genvars(temp)
        title("RDDENSITY PLOT: Housing Data") xtitle("area-90") xlabel(-20(5)20) legend(off);
        Thank you so much. I had a try just now, it worked. But, could you tell me why I can not use the code "graph_options" here? Is there something wrong with my download package rddensity?

        Comment


        • #5
          Now I am puzzled, but I have another guess. rdddensity is from the Stata Journal and also from GitHub. You are asked to explain where programs you use come from -- please see FAQ Advice 12 -- and here that is biting.

          The help for the Stata Journal version tells you to use the syntax you used,

          I made a guess, which was wrong. My guess was that the help says you can use graph_options and it just means that you are allowed to type any graph options. You don't have to, and indeed you should not type

          Code:
          graph_options()
          But that was wrong on my part (sorry). You are expected to type graph_options() and put extra options inside -- if you are using the Stata Journal code.

          But, but, but: the version at GitHub has different syntax and expects you to type something different.

          If you are using the code from GitHub and the help from the Stata Journal, that may be behind this. Or the other way round. The authors use different syntax.

          I would look carefully for different versions of this command on your system.

          Code:
          which rdddensity.ado, all
          
          which rdddensity.sthlp, all
          If you have further problems, please ping the program authors for support on their own command.

          Comment


          • #6
            Originally posted by Nick Cox View Post
            Now I am puzzled, but I have another guess. rdddensity is from the Stata Journal and also from GitHub. You are asked to explain where programs you use come from -- please see FAQ Advice 12 -- and here that is biting.

            The help for the Stata Journal version tells you to use the syntax you used,

            I made a guess, which was wrong. My guess was that the help says you can use graph_options and it just means that you are allowed to type any graph options. You don't have to, and indeed you should not type

            Code:
            graph_options()
            But that was wrong on my part (sorry). You are expected to type graph_options() and put extra options inside -- if you are using the Stata Journal code.

            But, but, but: the version at GitHub has different syntax and expects you to type something different.

            If you are using the code from GitHub and the help from the Stata Journal, that may be behind this. Or the other way round. The authors use different syntax.

            I would look carefully for different versions of this command on your system.

            Code:
            which rdddensity.ado, all
            
            which rdddensity.sthlp, all
            If you have further problems, please ping the program authors for support on their own command.
            Thanks for your patient answer, Nick. I did use RDDENSITY install from GitHub, and opened RDDENSITY.ado and RDDENSITY. sthlp to see the syntax of graph_options, but I still didn't find a way to solve the problem. here are the two from RDDENSITY package, could you please help me to check it one more time? thanks again.

            Attached Files

            Comment


            • #7
              Originally posted by Nick Cox View Post
              Now I am puzzled, but I have another guess. rdddensity is from the Stata Journal and also from GitHub. You are asked to explain where programs you use come from -- please see FAQ Advice 12 -- and here that is biting.

              The help for the Stata Journal version tells you to use the syntax you used,

              I made a guess, which was wrong. My guess was that the help says you can use graph_options and it just means that you are allowed to type any graph options. You don't have to, and indeed you should not type

              Code:
              graph_options()
              But that was wrong on my part (sorry). You are expected to type graph_options() and put extra options inside -- if you are using the Stata Journal code.

              But, but, but: the version at GitHub has different syntax and expects you to type something different.

              If you are using the code from GitHub and the help from the Stata Journal, that may be behind this. Or the other way round. The authors use different syntax.

              I would look carefully for different versions of this command on your system.

              Code:
              which rdddensity.ado, all
              
              which rdddensity.sthlp, all
              If you have further problems, please ping the program authors for support on their own command.
              Nick, The problem was be solved just now, i read the rddensity.ado carefully and rewrote the code about graph_options, thank you for telling me to check the RDDENSITY.ado install from GitHub.

              Comment

              Working...
              X