regression

is there an R function for Stata's xtnbreg?

Have been using STATA to run negative binomial regressions in a replication. Not sure what is under the hood on how STATA does this, but wanted to know if there is an R function/package that does the same thing? The R will give me a better idea of how this works, since I can see the code. ...

Specifying formula in R with glm without explicit declaration of each covariate

I would like to force specific variables into glm regressions without fully specifying each one. My real data set has ~200 variables. I haven't been able to find samples of this in my online searching thus far. For example (with just 3 variables): n=200 set.seed(39) samp = data.frame(W1 = runif(n, min = 0, max = 1), W2=runif(n, min ...

regression formula needed for hobby project

Hi all, I have a hobby website based around cars. I can source car sold data with 3 variables: price, mileage and age. If I collect enough data, is it possible to enter an age and mileage and return an extracted price? Assuming same car model in each case. Thanks. BTW I am a programmer not a mathematician so don't assume I know model...

Python or SQL Logistic Regression

Given time-series data, I want to find the best fitting logarithmic curve. What are good libraries for doing this in either Python or SQL? Edit: Specifically, what I'm looking for is a library that can fit data resembling a sigmoid function, with upper and lower horizontal asymptotes. ...

Howto overcome Unit Test Regression Problems...?

Hi, I was looking for some kind of a solution for software development teams which spend too much time handling unit test regression problems (about 30% of the time in my case!!!), i.e., dealing with unit tests which fails on a day to day basis. Following is one solution I'm familiar with, which analyzes which of the latest code change...

Two stage least square in R

Hi, I want to run a two stage probit least square regression in R. Does anyone know how to do this? Is there any package out there? I know it's possible to do it using Stata, so I imagine it's possible to do it with R. Thanks in advance, Manoel Galdino ...

3D Polynomial Regression

I need some pointers for writing a polynomial regression routine for 3-dimensional points (i.e. find the coefficients of an X order polynomial that is fitted to a certain number of 3D points). I've found code for 2D polynomial regression, however, I need to account for a 3rd dimension. I'm looking for code examples and/or explanations....

Is this regression algorithm original and effective?

I've had an idea for a non-linear regression algorithm that I haven't seen before: We fit a simple parametric function, such as a radial basis function, to the data using gradient descent. We find the residual from this and then fit a function to this, repeating this process to reduce the error and build up a collection of superimposed ...

Possible to unit test code that wasn't initially design to be tested, without changing any code?

Is it generally accepted that you cannot test code unless the code is setup to be tested? A hypothetical bit of code: public void QueueOrder(SalesOrder order) { if (order.Date < DateTime.Now-20) throw new Exception("Order is too old to be processed"); ... } Some would consider refactoring it into: protected DateTime M...

Fastest way to fit a parabola to set of points?

Hi, Given a set of points, what's the fastest way to fit a parabola to them? Is it doing the least squares calculation or is there an iterative way? Thanks Edit: I think gradient descent is the way to go. The least squares calculation would have been a little bit more taxing (having to do qr decomposition or something to keep things ...