Say I have a dataframe (let's call it DF
) where y
is the dependent variable and x1, x2, x3
are my independent variables. In R I can fit a linear model using the following code, and the .
will include all of my independent variables in the model:
# R code for fitting linear model
result = lm(y ~ ., data=DF)
I can't figure out how to do this with statsmodels using patsy formulas without explicitly adding all of my independent variables to the formula. Does patsy have an equivalent to R's .
? I haven't had any luck finding it in the patsy documentation.