xiaodai
xiaodai

Reputation: 16014

Is there a convenience function to compute the R^2 for GLM.jl's lm?

using RDatasets
cars = dataset("datasets", "cars")
m1 = lm(@formula(Dist~Speed), cars)

Now how do I extract the R^2 of m1? I tried summary(m1) and it didn't contain the information.

Upvotes: 4

Views: 860

Answers (1)

Bogumił Kamiński
Bogumił Kamiński

Reputation: 69909

You can use r2 or function (two names point at the same function).

For adjusted R^2 you can use adjr2 or adjr² function.

Upvotes: 5

Related Questions