jasondavies / science.js

Scientific and statistical computing in JavaScript.

Home Page:http://www.jasondavies.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stata Lpoly: Can this be replicated in science.js?

lapidus opened this issue · comments

Before diving in head-first, great if someone can give me an indication if I am likely to succeed in mirroring Stata's Lpoly function with Science.js.

//The Stata function:
lpoly yVar xVar [aweight=weight_example], at(xVar) bwidth(7) gen(outputVariable)  

lpoly performs a kernel-weighted local polynomial regression of yvar on xvar and displays a
graph of the smoothed values with (optional) confidence bands.

http://www.stata.com/manuals13/rlpoly.pdf

ps. I think my main concern is about the application of weights. In the example above I am using Stata's aweight ("Analytic weights"). Is there an equivalent of this in science.js?

Thank you!