Announcement

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

  • optimization with STATA

    I am unfamiliar with STATA programming, and I am trying to program some very rudimentary optimization problems.

    Suppose I have two variables: age and attitude. I want to find a cutoff in age such that I can minimize the MSE of predicting attitude with just a binary variable indicating whether age is above or below the cutoff.

    I thought I could achieve that with the function nl and I wrote the following:

    Code:
    nl (attitude = {b0} + {b1}*(age>{cutoff}), hasconstant(b0)
    but the result shows that both b1 and cutoff are constrained. How can I achieve what I want?

    Also, what if I want to find the cutoff with another criteria? One potential idea is finding the cutoff that maximizes the Kolmogorov-Smirnov test statistics between the distribution of attitude among the two age groups.

  • #2
    Uhhhhhh I'm kinda confused. Let's say age was 10 years old. What would you do then? Assign 1 as being above the cutoff and 0 below 10?

    And if so, why? To what end? Perhaps a little context might help.

    Comment


    • #3
      To find a "best" cutoff to classify the sample into two groups by age. I understand this is one of the ways to create nodes in a classification tree. I have something a little more complex in mind, but I think I need to learn the basics first, hence this overly simplified scenario.

      Comment


      • #4
        Uhhhh i know a little ML, so I'd actually recommended kmeans clustering for this problem, if the goal is classification

        Comment

        Working...
        X