Announcement

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

  • Kernel Regressions: NPREGRESS

    I have two non-parametric plots. I am told to:

    "Try to produce something similar to Figure 3, Panel A of the published article. That is, take the difference between these two non-parametric plots, and plot them out. I think you will need to calculate the difference based on a grid of X-values of the 2000 test score (the x variable) and calculate the conditional expectation of the Y-value. Then graph these in a connected line). Note, you probably won’t be able to exactly replicate their results because you are using a nonparametric kernel regression whereas they use a fan locally weighted regression. Try to get as close as you can. To get a confidence interval on this graph, bootstrap using the following procedure: one: draw a bootstrap sample from the pooled (treatment and control) distribution two: estimate the regression for the treatment group three: estimate the regression for the control group four: Estimate the difference for each of the grid points of x-values, and save this. Five: Repeat until you estimate the standard error at each point on the graph: then graph the confidence intervals."

    I don't have any idea how ot being at this. Can someone help? I am trying to imitate the following graph:
    Click image for larger version

Name:	parametric.PNG
Views:	1
Size:	71.7 KB
ID:	1538800

    Last edited by Lindsey Buck; 27 Feb 2020, 15:05. Reason: #nonparametric #kernel

  • #2
    Hi Lindsay,
    I think you can do this relatively easily, but you to provide more information about what your model looks like. In specific, I'm confused about what you call "Fan Regression".
    A reference would help understand what you want to do.
    From the information you provide, it seems that your model is somthing like this:
    Code:
    y=b0(z)+b1(x)*sex+b1(x)*treatment+b2(x)*gender+b3(x)*treatment*gender+error
    where x is your variable in the horizontal axis.
    If that is the case, you only need the Bandwidth to estimate the local regression:
    something like this:

    Code:
    * Instead of zero, you can use any of the points along X
    gen dx=x-0
    regress y  (c.treatment c.gender c.treatment#c.gender)##c.dx [pw=normalden(x,0,bw)]
    * where bw is your bandwidth
    You can also create a wrapper program to do the Bootstrapping.
    Code:
    program mybsreg, eclass
    regress y  (c.treatment c.gender c.treatment#c.gender)##c.dx [pw=normalden(x,0,bw)]
    end
    bootstrap: mybsreg
    HTH
    Fernando
    Last edited by FernandoRios; 27 Feb 2020, 19:21.

    Comment


    • #3
      Thank you!!

      Comment

      Working...
      X