# Fieldnames function does not work for GLM output

**URL:** <https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105>\
**Category:** General Usage\
**Tags:** glm\
**Created:** [September 18, 2018, 3:05am UTC](https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105 "2018-09-18T03:05:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwsohn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwsohn/32/2696_2.png) [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Post date:** [September 18, 2018, 3:05am UTC](https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105/1 "2018-09-18T03:05:04Z")

</div>

To my horror, fieldnames function does not work any more for me to inspect the GLM returned object.

glmout = glm(@formula(low ~ age + lwt + race),df,Binomial())

Previously fieldnames(glmout) worked find but it now generates

MethodError: no method matching fieldnames(::StatsModels.DataFrameRegressionModel{GeneralizedLinearModel{GlmResp{Array{Float64,1},Binomial{Float64},LogitLink},DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},Array{Float64,2}})  
Closest candidates are:  
fieldnames(!Matched::Core.TypeofBottom) at reflection.jl:175  
fieldnames(!Matched::Type{#s8} where #s8\<:Tuple) at reflection.jl:177  
fieldnames(!Matched::DataType) at reflection.jl:172  
…  
top-level scope at none:0  
include\_string(::Module, ::String, ::String) at loading.jl:1002  
include\_string(::Module, ::String, ::String, ::Int64) at eval.jl:30  
(::getfield(Atom, Symbol(“##108#113”)){String,Int64,String})() at eval.jl:91  
withpath(::getfield(Atom, Symbol(“##108#113”)){String,Int64,String}, ::Nothing) at utils.jl:30  
withpath at eval.jl:46 [inlined]  
#107 at eval.jl:90 [inlined]  
hideprompt(::getfield(Atom, Symbol(“##107#112”)){String,Int64,String}) at repl.jl:76  
macro expansion at eval.jl:89 [inlined]  
(::getfield(Atom, Symbol(“##106#111”)){Dict{String,Any}})() at task.jl:85

Is there any other method I can use to inspect the returned object?

Thanks

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [September 18, 2018, 3:17am UTC](https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105/2 "2018-09-18T03:17:02Z")

</div>

`fieldnames(typeof(obj))`; fieldnames works on the _type_ of the thing, not the thing itself.

---

<div class="post-metadata">

**Author:** ![mwsohn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwsohn/32/2696_2.png) [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Post date:** [September 18, 2018, 4:43am UTC](https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105/3 "2018-09-18T04:43:15Z")

</div>

Thank you.

---

<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 18, 2018, 10:27am UTC](https://discourse.julialang.org/t/fieldnames-function-does-not-work-for-glm-output/15105/4 "2018-09-18T10:27:31Z")

</div>

Also [PSA: use Julia 0.7 if you are upgrading](https://discourse.julialang.org/t/psa-use-julia-0-7-if-you-are-upgrading/13321) might be helpful here - I think this should have given a deprecation warning on 0.7!?
