tests/testthat/_snaps/fitted-values.md

fitted values works for a ziP() model

Code
  fitted_values(m_ziP)
Output
  # A tibble: 400 x 5
      .row .fitted    .se .lower_ci .upper_ci
     <int>   <dbl>  <dbl>     <dbl>     <dbl>
   1     1  0.521  0.127     0.198      1.29 
   2     2  0.0525 0.122     0.0207     0.135
   3     3  0.470  0.211     0.0932     2.00 
   4     4  0.608  0.112     0.262      1.33 
   5     5 23.6    0.0710   20.5       27.1  
   6     6  0.381  0.105     0.170      0.832
   7     7  0.344  0.103     0.156      0.744
   8     8  0.0913 0.153     0.0282     0.297
   9     9  0.367  0.123     0.143      0.909
  10    10  2.47   0.111     1.26       3.99 
  # i 390 more rows

fitted values works for a mvn() model

Code
  fitted_values(m_mvn)
Output
  # A tibble: 600 x 10
      .row      x0    x1    x2     x3 .y        .fitted   .se .lower_ci .upper_ci
     <int>   <dbl> <dbl> <dbl>  <dbl> <chr>       <dbl> <dbl>     <dbl>     <dbl>
   1     1 0.114   0.353 0.281 0.642  response1    2.62 0.194     2.24       3.01
   2     2 0.622   0.981 0.174 0.410  response1    8.88 0.241     8.41       9.35
   3     3 0.609   0.539 0.170 0.921  response1    4.75 0.182     4.39       5.11
   4     4 0.623   0.444 0.561 0.451  response1    4.12 0.188     3.76       4.49
   5     5 0.861   0.949 0.429 0.914  response1    7.53 0.220     7.10       7.96
   6     6 0.640   0.452 0.389 0.0264 response1    4.13 0.190     3.76       4.51
   7     7 0.00950 0.191 0.844 0.342  response1    1.48 0.285     0.923      2.04
   8     8 0.233   0.992 0.209 0.256  response1    8.57 0.248     8.08       9.05
   9     9 0.666   0.548 0.509 0.777  response1    4.69 0.187     4.32       5.05
  10    10 0.514   0.769 0.395 0.296  response1    6.64 0.177     6.30       6.99
  # i 590 more rows

fitted values works for a multinom() model

Code
  fitted_values(m_multinom)
Output
  # A tibble: 3,000 x 8
      .row    x1      x2 .category .fitted    .se .lower_ci .upper_ci
     <int> <dbl>   <dbl> <fct>       <dbl>  <dbl>     <dbl>     <dbl>
   1     1 0.721 0.0778  1           0.191 0.0268    0.144      0.249
   2     2 0.876 0.844   1           0.119 0.0214    0.0831     0.168
   3     3 0.761 0.00681 1           0.184 0.0294    0.133      0.249
   4     4 0.886 0.351   1           0.176 0.0245    0.133      0.230
   5     5 0.456 0.686   1           0.179 0.0202    0.143      0.222
   6     6 0.166 0.254   1           0.136 0.0206    0.101      0.182
   7     7 0.325 0.174   1           0.174 0.0227    0.134      0.223
   8     8 0.509 0.707   1           0.177 0.0204    0.141      0.221
   9     9 0.728 1.000   1           0.118 0.0231    0.0798     0.171
  10    10 0.990 0.950   1           0.153 0.0388    0.0914     0.245
  # i 2,990 more rows


Try the gratia package in your browser

Any scripts or data that you put into this service are public.

gratia documentation built on Feb. 7, 2026, 9:06 a.m.