Announcement

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

  • How to write a spline regression equation

    I have this basic regression model that I would like to make into a spline with a knot at -1. How would I write it? Is it possible for me to write it as a single equation where I subtract 1? Here's the basic model without the spline:

    y0 = b0 + b1(Time 1 grade) + b3(Covariates) + e

  • #2
    Did you look at the methods and formulas section of the manual entry for mkspline? If you did not do so, then there is your answer. If you did, can you tell us why you think it did not answer your question?
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Hi Maarten, I did look at the help file for mkspline but did not see any formulas listed. All I found were codes to use in Stata. Is there another entry I am not aware of?

      Comment


      • #4
        Maarten specifically referred to the manual entry. You can get to it from the help or even directly: http://www.stata.com/manuals14/rmkspline.pdf

        Comment


        • #5
          In Stata there is a difference between the help-file and the manual. The help-file is what you get when you type help something, the manual is a pdf-file. The latter is much more detailed and typically contains a section called methods and formulas which contains the formulas you are looking for.
          ---------------------------------
          Maarten L. Buis
          University of Konstanz
          Department of history and sociology
          box 40
          78457 Konstanz
          Germany
          http://www.maartenbuis.nl
          ---------------------------------

          Comment


          • #6
            Hi, Karlie!

            Running spline regressions is fairly convenient. Maartan is right regarding the mkspline command.

            I would also recommend Michael Mitchell's book (see link), specifically pages 84 to 95, where there is a nice exposition and code.

            In addition, as the link below explains, you can download the datasets from the book and as well as his "showcoding" package, which helps with visualization of the knots as cross-tab. I've found it very useful.

            Hope this helps,
            - Nate

            http://www.stata-press.com/data/ivrm.html

            Nathan E. Fosse, PhD
            [email protected]

            Comment

            Working...
            X