sm1116
sm1116

Reputation: 97

Analog in Julia to coefficients() in R

How can I extract coefficients from a GLM run in Julia. In R, I can fit a regression and just use coefficients():

lm.fit <- lm(y ~ . - 1, data = data.ols)
coefficients(lm.fit)

Is there a similar way to access coefficients in Julia so that I can use them in future formulas that I write?

My Julia code is:

olsFitFinal = fit(LinearModel, Y ~ -1 + Base + TRc + TCkRc + TcRc + R + RT,
                olsDat)

It seems that an answer at http://bit.ly/1EwSeCg implies the use of coefs() but that does not work for me.

Upvotes: 0

Views: 176

Answers (1)

sm1116
sm1116

Reputation: 97

Doing some more searching I found the solution:

coef(olsFitFinal)

Upvotes: 4

Related Questions