# GLM: "no method matching fit"

**URL:** https://discourse.julialang.org/t/glm-no-method-matching-fit/28603
**Category:** New to Julia
**Tags:** fit, glm
**Created:** [September 10, 2019, 1:19pm UTC](https://discourse.julialang.org/t/glm-no-method-matching-fit/28603 "2019-09-10T13:19:44Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [September 10, 2019, 1:30pm UTC](https://discourse.julialang.org/t/glm-no-method-matching-fit/28603/3 "2019-09-10T13:30:56Z")

</div>

As Kristoffer says, an [MWE](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) would be helpful here. The following works for me:

```julia
julia> using GLM, DataFrames

julia> data = DataFrame(A = rand(1:122, 50), B = rand(22.1:0.1:22.5, 50))
50×2 DataFrame
│ Row │ A │ B │
│ │ Int64 │ Float64 │
├─────┼───────┼─────────┤
│ 1 │ 4 │ 22.1 │
│ 2 │ 117 │ 22.5 │
...

julia> lm(@formula(A ~ B), data)
A ~ 1 + B

Coefficients:
──────────────────────────────────────────────────────────────────────────────
              Estimate Std. Error t value Pr(>|t|) Lower 95% Upper 95%
──────────────────────────────────────────────────────────────────────────────
(Intercept) -470.991 882.242 -0.533857 0.5959 -2244.86 1302.87
B 23.7686 39.5652 0.600744 0.5508 -55.7826 103.32
──────────────────────────────────────────────────────────────────────────────

```

(modulo some DataFrames deprecation warnings currently)

---

_[View the full topic](https://discourse.julialang.org/t/glm-no-method-matching-fit/28603)._
