Git Product home page Git Product logo

lspline's Introduction

lspline: Linear Splines with Convenient Parameterizations

R-CMD-check rstudio mirror downloads cran version

Linear splines with convenient parameterizations such that:

  • coefficients are slopes of consecutive segments
  • coefficients capture slope change at consecutive knots

Knot locations can be specified

  • manually (lspline())
  • at breaks dividing the range of x into q equal-frequency intervals (qlspline())
  • at breaks dividing the range of x into n equal-width intervals (elspline())

Inspired by Stata command mkspline and function lspline() from package ares (Junger and Ponce de Leon 2011). As such, the implementation follows Greene (2003), chapter 7.5.2.

Installation

From CRAN or development version using remotes:

remotes::install_github("mbojan/lspline", build_vignettes = TRUE)

Examples

See package homepage and the vignette.

References

Greene, William H. 2003. Econometric Analysis. Pearson Education.

Junger, Washington L., and Antonio Ponce de Leon. 2011. Ares: Environment Air Pollution Epidemiology: A Library for Timeseries Analysis. R package version 0.7.2 in CRAN’s archives.

lspline's People

Contributors

mbojan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lspline's Issues

Vignette imports

R CMD check says

* checking for unstated dependencies in vignettes ... NOTE
'::' or ':::' imports not declared from:
  ‘broom’ ‘scales’
'library' or 'require' call not declared from: ‘ggplot2’

Nice effect names

Make effect (coefficient) names nicer.

For marginal=TRUE perhaps include the knot position, e.g.:

  • lspline.x>5, lspline.x>10 and so on, or
  • interval symbols as from cut()

Coefficient names

Craig writes via e-mail:

I am having great results with your linear spline package but ran into one issue. I cannot name the parameters. When I use the names option I just get an error message:

Error: argument 'names' is not used (yet)

Any idea how to get names to work?

Fix package title

R CMD check says

The Title field should be in title case, current version then in title case:
‘Piecewise-linear splines’
‘Piecewise-Linear Splines’

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.