Announcement

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

  • Coding cubic and quadratic regression with 2 variables

    Variables: fingerlings (number), credit, equity
    If quadratic regression is coded as
    Code:
    regress fingerlings credit credit2
    where, credit2 is credit*credit
    And cubic regression is coded as
    Code:
    regress fingerlings credit credit2 credit3
    where credit3 is credit*credit2

    How should i code quadratic and cubic regression with both credit and equity in play.

    Thanks.

  • #2
    It isn't clear what you want when you speak of "equity in play." But first, let me suggest you use factor-variable notation instead of creating higher-order terms. Your cubic model shown in #1 can be more compactly handled as:

    Code:
    regress fingerlings c.credit##c.credit##c.credit
    Returning to "equity in play," I don't grasp whether you just want to add a polynomial involving equity, or if you also want cross-product terms between equity and credit. If you just want to add an equity polynomial (and go up to 4th degree in both variables):

    Code:
    regress fingerlings c.credit##c.credit##c.credit##c.credit c.equity##c.equity##c.equity##c.equity
    does that.

    If you want all possible crossproduct terms between credit and equity as well:

    Code:
    regress fingerlings c.(credit equity)##c.(credit equity)##c.(credit equity)##c.(credit equity)
    All of that said, before you proceed, I suggest you consult with an expert in your discipline about this model. There are very few things in the real world that follow high-degree polynomials. Even quadratic models are usually very crude approximations used just for their mathematical simplicity; usually they are mediocre descriptions of the actual data generating process, or worse. (Motion of a particle in a constant force field is the rare exception to this rule.) So I would discuss this with somebody very knowledgeable in your discipline to verify that a model of this nature is plausible.

    Comment

    Working...
    X