Announcement

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

  • Weighted nonlinear least squares

    Hi Guys,


    I should estimate the probit model by weighted nonlinear least squares using the inverse of the
    variance of the dependent variable as weights. Actually, this is my first time that I'm working in STATA with this kind of problems.
    Firstly, just to understand, I've estimated the Non-linear least square as coded below:

    gen cons=1
    global x1 nwifeinc educ exper expersq age kidslt6 kidsge6 cons
    nl (y = normal({xb: $x1})

    and it seems working. Now, even if I've red the documentation, I'm having trouble to the next step.
    Do you have any suggestion?


    Thanks



    Rufus


  • #2
    The type of weighting you describe is what -aweights- do. And -nl- allows them.

    Comment


    • #3
      Thank you for your reply Clyde. I've already tryied the command -aweights- in this way:

      nl (y = normal({xb: $x1})) [aweight = y]

      but it doesn't work. Stata shows the following error:

      "y has zero variance"
      r(498)

      Do you think that this is due to the fact that my dependet variable is dichotomic?

      Thank you.


      Rufus

      Comment


      • #4
        No, you are mis-specifying the aweight. The aweight has to be a variable whose value in any observation is inversely proportional to the variance of y in that observation. The typical situation is where in any given observation there is a variable, call it n, and the outcome variable y is the average of n observations of y. Then n is inversely proportional to the variance of y, and you would use [aweight = n]. So you need a variable like n here.

        However, the message "y has zero variance" is disturbing in any case. For modeling a probit, y has to be dichotomous. But having no variance means that it is either always 0 or always 1--which will get you nowhere.

        Comment

        Working...
        X