[R] Is there any multivariate regression function to combine all variables from a dataset?

Miguel Ratón Almansa cibermike at telefonica.net
Fri Nov 30 12:36:41 CET 2007

Hi everybody,

I've been looking for a function that combines all variables from a 
dataset because I need to do multivariate regression.

If we have linear regression with an expression like f(x) = a0 + 
sum(ai*xi) what I want to do is something like f(x) = a0 + sum(ai*xi) + 
sum(sum(bij * xi * xj)) + sum(sum(sum(cijk*xi*xj*xk))) + ...

So I need a function that combines all the values from the dataset in 
order to produce the xi, xi*xj, xi*xj*xk values. The variables can take 
values in different ranges so I need that the function controls the 
scale. After that I would apply the regression to the obtained dataset.


X1  X2
n11 n12
n21 n22
n31 n32

X1   X2   X1*X2
n11 n12   n11*n12
n21 n22      ...
n31 n32      ...

Is there any function like this in which, in addition of the above 
mentioned, I can specify the degree of combination?

Thanks for your help,

More information about the R-help mailing list