# Getting parameter estimate table

**URL:** <https://discourse.pumas.ai/t/getting-parameter-estimate-table/280>\
**Category:** Diagnostics\
**Created:** [February 26, 2020, 4:41pm UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280 "2020-02-26T16:41:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpark](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wpark](https://discourse.pumas.ai/u/wpark)\
**Post date:** [February 26, 2020, 4:41pm UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/1 "2020-02-26T16:41:50Z")

</div>

After running NLME model, we can check parameter estimate in FittedPumasModel.

```auto
res = fit(mymodel,data,param,Pumas.FOCEI())
julia> res
FittedPumasModel

Successful minimization: true

Likelihood approximation: Pumas.FOCEI
Deviance: 19603.855
Total number of observation records: 1728
Number of active observation records: 1728
Number of subjects: 24

---------------------
           Estimate
---------------------
tvcl 0.96561
tvv 19.944
tvka 0.9818
Ω₁,₁ 0.05888
Ω₂,₂ 0.063136
Ω₃,₃ 0.16558
σ_prop 0.042221
---------------------

```

Is there a way to get the parameter estimate as a dataframe?

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/andreasnoack/32/22_2.png) [@andreasnoack](https://discourse.pumas.ai/u/andreasnoack)\
**Post date:** [February 27, 2020, 8:27am UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/2 "2020-02-27T08:27:55Z")

</div>

Currently, I don’t think that is supported. I’m interested in knowing why you’d like the estimates as a dataframe. You can extract the estimates to a `NamedTuple` with `coef(res)` which I personally think is the more convenient structure for the parameters.

---

<div class="post-metadata">

**Author:** ![wpark](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wpark](https://discourse.pumas.ai/u/wpark)\
**Post date:** [February 27, 2020, 3:53pm UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/3 "2020-02-27T15:53:10Z")

</div>

Usually, our final deliverable for parameter estimate is as a table in the report.  
The below link is a vignettes of R package `nonmemica` for creating NONMEM parameter table. I don’t use this package, but it shows why I’m asking the parameter estimates as a data frame.  
[https://cran.r-project.org/web/packages/nonmemica/vignettes/parameter-table.html](https://cran.r-project.org/web/packages/nonmemica/vignettes/parameter-table.html)

When I try `coef(res)`, I can see parameter estimates as `NamedTuple` but I don’t have an idea how to manipulate this into table I want.

```auto
julia> coef(result)
(TVCL = 2.7907388779868376, TVVC = 47.64457787187141, TVQ = 29.03416096300452, TVVP = 151.70681644475079, Ω = PDMats.PDiagMat{Float64,Array{Float64,1}}(4, [0.1467966100709955, 0.17643085438516706, 0.22914868909450084, 0.
18957024013038068], [6.81214640798836, 5.667942852086943, 4.363978707238427, 5.275089588493586]), σ_prop = 0.01900908127024216)

```

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/andreasnoack/32/22_2.png) [@andreasnoack](https://discourse.pumas.ai/u/andreasnoack)\
**Post date:** [February 27, 2020, 9:03pm UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/4 "2020-02-27T21:03:07Z")

</div>

Thanks. That was a useful reference. I believe there is ongoing work on supporting export the fit results to e.g. Markdown or HTML. If you had access to similar output functionality as provided by `nonmemica` directly from a fitted Pumas model, would that solve your problem or would you still need the dataframe for postprocessing?

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [February 28, 2020, 7:38am UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/5 "2020-02-28T07:38:36Z")

</div>

in general, if you have a NamedTuple, you should be able to convert that to a DatFrame. e.g.

```auto
julia> myres = (a = 2, b=3)
(a = 2, b = 3)

julia> DataFrame([myres])
1×2 DataFrame
│ Row │ a │ b │
│ │ Int64 │ Int64 │
├─────┼───────┼───────┤
│ 1 │ 2 │ 3 │

```

However, the problem we have in converting the NamedTuple of our coefficients is that the Omega parameters are an array and are printed with type information, and hence the DataFrame constructor fails on this result. Hopefully, we will be able to get a simple convenience soon.

---

<div class="post-metadata">

**Author:** ![wpark](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wpark](https://discourse.pumas.ai/u/wpark)\
**Post date:** [February 28, 2020, 5:14pm UTC](https://discourse.pumas.ai/t/getting-parameter-estimate-table/280/6 "2020-02-28T17:14:45Z")

</div>

Thank you @andreasnoack and @vijay.

I think many user has their own preference for this kinds of work. It would be great if Pumas provide nice final output directly with simple one line of function. But some user may prefer their own way of manipulation or post-processing of final result.

NONMEM provide several output files which can be processed outside of NONMEM. In another NLME software Monolix, which is GUI based software and it shows every plot and table after run but those results can be exported as a separate file for further manipulation. For population parameter, Monolix return file `populationParameters.txt` as below.

```auto
parameter,value
ka_pop,1.53264420692351
V_pop,0.455503642172079
Cl_pop,0.0401723641322292
omega_ka,0.67105477569176
omega_V,0.126281479740844
omega_Cl,0.27062337275905
a,0.433279579876172
b,0.0542595263836769

```

I’m just one of many modelers and I prefer the latter (data frame).
