Announcement

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

  • Locpoly issue

    We are working on a panel primary survey socioeconomic data. We are trying to compare semiparametric models (semipar) and locpoly models using LR test to check which model is better. But unfortunately we are not successful because we get an error saying that number of observations differ in both the tests. I tried to impose the condition to use the same set of observations in both the models but still same error persists. When I checked the log file I found that the number of observations used in semipar is around 13k whereas the estimates in locpoly are showing only 3k observations. Unable to understand and solve this issue.

    Request somebody to help

  • #2
    Hi Anupa,
    First of all. Do you mind sharing the code you are using to implement the test?
    Second, semipar and locpoly are community-contributed commands, so LR test may not be adequate for this purpose.
    If you provide more information about your problem, we may be able to provide better feedback
    Fernando

    Comment


    • #3
      locpoly was written by people then at StataCorp -- although two have moved on since -- but as Fernando points out had community-contributed status. But that was 2003 to 2006:


      Code:
      SJ-6-4  st0053_3  . . . . . . . . . . . . . . . .  Software update for locpoly
              . . . . . . . . . . R. G. Gutierrez, J. M. Linhart, and J. S. Pitblado
              (help locpoly if installed)
              Q4/06   SJ 6(4):597
              update permitting override of default axes titles
      
      SJ-5-2  st0053_2  . . . . . . . . . . . . . . . .  Software update for locpoly
              . . . . . . . . . . R. G. Gutierrez, J. M. Linhart, and J. S. Pitblado
              (help locpoly if installed)
              Q2/05   SJ 5(2):285
              bug fix for locpoly; dialog boxes updated for Stata 9
      
      SJ-5-1  st0053_1  . . . . . . . . . . . . . . . .  Software update for locpoly
              . . . . . . . . . . .  R. Gutierrez, J. M. Linhart, and J. S. Pitblado
              (help locpoly if installed)
              Q1/05   SJ 5(1):139
              bug fix for locpoly
      
      SJ-3-4  st0053  . .  From the help desk: Local polynomial reg. & Stata plugins
              . . . . . . . . . . R. G. Gutierrez, J. M. Linhart, and J. S. Pitblado
              (help locpoly if installed)
              Q4/03   SJ 3(4):412--419
              provides command for performing local polynomial regression;
              discusses use of a Stata plugin
      I suspect the advice may be to use lpoly instead, although I don't have advice on the specific problem in #1.

      Comment


      • #4
        Hi FernandoRios,

        Thank you for your response. Below is the code we are using;

        locpoly ln_cropval_ha ln_plotsizeinha if op_area_inha>0 & extremes ==0, adoonly noscatter epanechnikov degree(0) width(3)
        *plot(line CV_plot_Eq_0p_p ln_plotsizeinha if op_area_inha>0 & extremes ==0 & selection==1)
        gen selection=e(sample)
        estimates store CV_locpoly_Eq0

        graph save locpoly_CV_plot_Eq0, replace

        *Equation 3np
        eststo:semipar dm_ln_cropval_ha $Xcv_dm $Q_dm $controls_dm $year if op_area_inha>0 & extremes ==0 & selection==1, nonpar(dm_ln_plotsizeinha) robust generate(CV_plot_Eq_3np_p) cluster(uniqueplotID ) ci
        estimates store CV_plot_Eq_3np_V2
        graph save CV_plot_Eq_3np, replace
        label variable CV_plot_Eq_3np_p "Equation 3 non-parametric"

        lrtest CV_locpoly_Eq0 CV_plot_Eq_3np_V2

        Hope this helps in better understanding of the problem and suggesting a solution.

        Regards
        Anupama

        Comment


        • #5
          Hi Nick,

          Thank you, I will try using lpoly also

          Comment


          • #6
            Hi Anupama,
            I think I understand what you want to do, but you cannot do it the way you are thinking.
            As Nick mentioned, -locpoly- is a predecessor of lpoly. Niether of them is a "standard" estimation command. So they do not produce estimation outputs as you normally get using commands like regress.
            In fact, and im guessing as a legacy behavior from locpoly, it does procude some estimation output, but ifyou look at it (ereturn list), it only provides you with data for the last local regression estimated.
            This simply means that an LRtest is not appropriate.

            So let me restate your question, and a possible alternative solution:
            H0:E(y|x,z)=xb+f(z)
            H1:E(y|x,z)=f(z)

            If you want to assume semipar estimates the nonparametric component optimally, you could simply run a test for all coefficients that are parametric.

            HTH
            Fernando

            Comment


            • #7
              Thank you very much FernandoRios, I will work on it further and get back if there are any issues
              Yes, this has helped a lot

              Regards
              Anupama

              Comment

              Working...
              X