Least Square Regression

Mar 11, 2013 at 9:57 PM
How do I do this in r.net?
mydata <- read.csv('GoodCarbsDesign.csv', header = TRUE)
fit <- lm(rate ~ +e1+e2+e3+e4+e5+e6+e7+e8+e9+e10+e11+e12+e13+e14+e15+e16+e17+e18+e19+e20+e21+e22+e23+e24+e25+e26+e27+e28+e29+e30+e31+e32+e33+e34+e35+e36, data=mydata) coefficients(fit)

Or if I can load sql table data instead of loading the csv
Mar 13, 2013 at 8:48 PM
Edited Mar 13, 2013 at 8:49 PM
Anything?
Maybe something like this:
Matrix(
var xdata = new Matrix(
 new double[,]{{1, 36, 66, 45, 32},
             {1, 37, 68, 12, 2},
             {1, 47, 64, 78, 34},
             {1, 32, 53, 56, 32},
             {1, 1, 101, 24, 90}});

var ydata = new double[] { 15, 20, 25, 55, 95 };
lm(ydata ~ xdata) 
or should I do multiple doubles and then
var ydata = new double[] { 15, 20, 25, 55, 95 };
var xdata1 = new double[] {1, 36, 66, 45, 32};
var xdata2 = new double[] {1, 37, 68, 12, 2};
var xdata3 = new double[] {1, 47, 64, 78, 34};
...
lm(ydata ~ xdata1 + xdata2 + xdata3 , ...)