Skip to content

Commit

Permalink
update news and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jknowles committed Feb 7, 2024
1 parent 5df29ad commit 475e0b4
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 71 deletions.
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -4,6 +4,7 @@

- Maintenance release to fix minor issues with function documentation
- Fix #130 by avoiding conflict with `vcov` in the `merDeriv` package
- Upgrade package test infrastructure to 3e testthat specification

## merTools 0.6.1

Expand Down
7 changes: 7 additions & 0 deletions README.Rmd
Expand Up @@ -47,6 +47,13 @@ install.packages("merTools")

## Recent Updates


## merTools 0.6.2 (Early 2024)

- Maintenance release to fix minor issues with function documentation
- Fix #130 by avoiding conflict with `vcov` in the `merDeriv` package
- Upgrade package test infrastructure to 3e testthat specification

## merTools 0.6.1 (Spring 2023)

- Maintenance release to keep package listed on CRAN
Expand Down
145 changes: 77 additions & 68 deletions README.md
Expand Up @@ -30,6 +30,12 @@ install.packages("merTools")

## Recent Updates

## merTools 0.6.2 (Early 2024)

- Maintenance release to fix minor issues with function documentation
- Fix \#130 by avoiding conflict with `vcov` in the `merDeriv` package
- Upgrade package test infrastructure to 3e testthat specification

## merTools 0.6.1 (Spring 2023)

- Maintenance release to keep package listed on CRAN
Expand Down Expand Up @@ -133,16 +139,16 @@ standard objects produced by `lm` and `glm`:
predictInterval(m1, newdata = InstEval[1:10, ], n.sims = 500, level = 0.9,
stat = 'median')
#> fit upr lwr
#> 1 3.107632 5.190402 0.9368052
#> 2 3.097741 4.879558 1.2738180
#> 3 3.401938 5.503266 1.3132856
#> 4 3.121414 5.060498 1.1299338
#> 5 3.290234 5.422217 1.2647681
#> 6 3.146418 5.023299 1.4372531
#> 7 4.086394 6.158931 1.9473926
#> 8 3.738121 5.631336 1.7886288
#> 9 3.763437 5.734384 1.6697661
#> 10 3.352128 5.337015 1.2505294
#> 1 3.215698 5.302545 1.4367495
#> 2 3.155941 5.327796 1.2210140
#> 3 3.374129 5.287901 1.4875231
#> 4 3.101672 5.183841 0.9248584
#> 5 3.299367 5.298370 1.3287058
#> 6 3.147238 5.368311 1.1132248
#> 7 4.155194 6.273147 2.2167207
#> 8 3.873493 5.705669 1.9152401
#> 9 3.740978 5.737517 2.0454222
#> 10 3.291242 5.297614 1.2375007
```

Note that `predictInterval` is slower because it is computing
Expand All @@ -164,53 +170,53 @@ interval.
predictInterval(m1, newdata = InstEval[1:10, ], n.sims = 200, level = 0.9,
stat = 'median', which = "all")
#> effect fit upr lwr obs
#> 1 combined 3.25969862 5.093473 1.088987 1
#> 2 combined 3.25185416 5.195660 1.212398 2
#> 3 combined 3.48995449 5.513208 1.432098 3
#> 4 combined 3.33674443 4.943025 1.220998 4
#> 5 combined 3.29898222 5.594381 1.301636 5
#> 6 combined 3.22542573 5.121188 1.285540 6
#> 7 combined 4.35693740 6.456601 2.095860 7
#> 8 combined 3.77082296 5.755422 1.540146 8
#> 9 combined 3.77734423 6.131939 2.157273 9
#> 10 combined 3.28954595 5.079436 1.221874 10
#> 11 s -0.08603730 2.203910 -1.704490 1
#> 12 s 0.22623596 1.850055 -1.624032 2
#> 13 s 0.30822074 1.894273 -1.964165 3
#> 14 s 0.22535767 2.270494 -1.856316 4
#> 15 s -0.14243952 1.787597 -2.050745 5
#> 16 s -0.30163547 1.817632 -2.103720 6
#> 17 s 0.38506882 2.098101 -1.341332 7
#> 18 s 0.44294445 2.415432 -1.500022 8
#> 19 s 0.40448327 2.399836 -1.913328 9
#> 20 s 0.22839660 2.570579 -1.745981 10
#> 21 d -0.31888163 1.606477 -2.297953 1
#> 22 d -0.37366911 1.555461 -2.075957 2
#> 23 d -0.16054175 1.715221 -2.203618 3
#> 24 d -0.20694151 1.876587 -2.340907 4
#> 25 d 0.11129869 2.016248 -1.774396 5
#> 26 d -0.05587943 1.782312 -2.069027 6
#> 27 d 0.56077534 2.799003 -1.288401 7
#> 28 d 0.19538590 2.276306 -1.843640 8
#> 29 d 0.26885661 2.163566 -1.712320 9
#> 30 d -0.26743035 1.520186 -2.388651 10
#> 31 fixed 3.51054377 5.293941 1.341126 1
#> 32 fixed 3.26108728 4.927388 1.169438 2
#> 33 fixed 2.97127880 4.866901 1.215838 3
#> 34 fixed 3.03712179 5.036753 1.154742 4
#> 35 fixed 3.39117433 5.284877 1.437624 5
#> 36 fixed 3.32728732 5.126942 1.577967 6
#> 37 fixed 3.34239946 5.172533 1.513171 7
#> 38 fixed 3.35180632 5.118299 1.431649 8
#> 39 fixed 3.58880671 5.105028 1.554977 9
#> 40 fixed 3.27099171 5.169194 1.489591 10
#> 1 combined 3.35554348 5.217964 1.615782 1
#> 2 combined 3.21487934 5.327824 1.114338 2
#> 3 combined 3.44493242 5.474256 1.809136 3
#> 4 combined 3.24123655 4.838427 1.272174 4
#> 5 combined 3.20539661 5.367651 1.068128 5
#> 6 combined 3.54335144 5.481756 1.585809 6
#> 7 combined 4.23212790 6.267669 2.284923 7
#> 8 combined 4.05055116 5.684968 1.931558 8
#> 9 combined 3.84266853 5.492163 2.091312 9
#> 10 combined 3.24121727 5.183680 1.196101 10
#> 11 s -0.02342248 1.948494 -1.691035 1
#> 12 s 0.04148408 2.091467 -1.782386 2
#> 13 s 0.04477028 2.087629 -2.144621 3
#> 14 s 0.26160482 2.114509 -1.733429 4
#> 15 s -0.10803386 1.714535 -1.982283 5
#> 16 s -0.04962613 1.916212 -1.909187 6
#> 17 s 0.24916111 2.001528 -1.628554 7
#> 18 s 0.19640074 2.070513 -1.473660 8
#> 19 s 0.27031215 2.119763 -1.643120 9
#> 20 s 0.13772544 2.313012 -1.855489 10
#> 21 d -0.32196201 1.357316 -2.397083 1
#> 22 d -0.29691477 1.422141 -2.662141 2
#> 23 d 0.24828667 1.782181 -1.987563 3
#> 24 d -0.37893052 1.471225 -2.350781 4
#> 25 d 0.02142086 2.172075 -2.148417 5
#> 26 d 0.07926221 2.003462 -1.677765 6
#> 27 d 0.76480967 2.767889 -1.274501 7
#> 28 d 0.08757337 2.374201 -1.958689 8
#> 29 d 0.25289032 2.083732 -1.376630 9
#> 30 d -0.17775160 1.601744 -2.115104 10
#> 31 fixed 3.16750528 5.010517 1.371678 1
#> 32 fixed 3.21493166 5.246672 1.074857 2
#> 33 fixed 3.36233628 5.581696 1.474776 3
#> 34 fixed 3.17926915 5.107315 1.621278 4
#> 35 fixed 3.16562882 5.136197 1.156010 5
#> 36 fixed 3.15944014 5.114967 1.506315 6
#> 37 fixed 3.32101367 5.149819 1.407884 7
#> 38 fixed 3.34020282 5.189215 1.651446 8
#> 39 fixed 3.17901802 5.000429 1.132874 9
#> 40 fixed 3.41100236 5.207451 1.555844 10
```

This can lead to some useful plotting:

``` r
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.2.2
#> Warning: package 'ggplot2' was built under R version 4.3.2
plotdf <- predictInterval(m1, newdata = InstEval[1:10, ], n.sims = 2000,
level = 0.9, stat = 'median', which = "all",
include.resid.var = FALSE)
Expand All @@ -229,6 +235,9 @@ ggplot(plotdf, aes(x = obs, y = fit, ymin = lwr, ymax = upr)) +
facet_grid(residVar~effect) + theme_bw()
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
```

![](man/figures/README_unnamed-chunk-7-1.png)<!-- -->
Expand Down Expand Up @@ -256,12 +265,12 @@ fixed and random effect parameters.
feSims <- FEsim(m1, n.sims = 100)
head(feSims)
#> term mean median sd
#> 1 (Intercept) 3.22302416 3.22328224 0.01893656
#> 2 service1 -0.07353238 -0.07503196 0.01322848
#> 3 lectage.L -0.18550746 -0.18689223 0.01757622
#> 4 lectage.Q 0.02531346 0.02532793 0.01262718
#> 5 lectage.C -0.02446487 -0.02332242 0.01217267
#> 6 lectage^4 -0.02074847 -0.02171527 0.01314005
#> 1 (Intercept) 3.22469489 3.22427807 0.01767782
#> 2 service1 -0.07112136 -0.07190156 0.01382577
#> 3 lectage.L -0.18681442 -0.18833173 0.01617233
#> 4 lectage.Q 0.02208290 0.02252175 0.01259911
#> 5 lectage.C -0.02656846 -0.02507924 0.01099316
#> 6 lectage^4 -0.02165334 -0.02073531 0.01355675
```

And we can also plot this:
Expand All @@ -278,12 +287,12 @@ We can also quickly make caterpillar plots for the random-effect terms:
reSims <- REsim(m1, n.sims = 100)
head(reSims)
#> groupFctr groupID term mean median sd
#> 1 s 1 (Intercept) 0.15555959 0.14798520 0.3359070
#> 2 s 2 (Intercept) -0.03924940 -0.03158545 0.3216017
#> 3 s 3 (Intercept) 0.32218754 0.29815012 0.2944466
#> 4 s 4 (Intercept) 0.22220605 0.19904690 0.2887927
#> 5 s 5 (Intercept) 0.05738118 0.03711978 0.3373406
#> 6 s 6 (Intercept) 0.14302324 0.14638548 0.2363066
#> 1 s 1 (Intercept) 0.21300834 0.22465501 0.3266393
#> 2 s 2 (Intercept) -0.04278168 -0.08474934 0.3164631
#> 3 s 3 (Intercept) 0.41998629 0.42229608 0.2865010
#> 4 s 4 (Intercept) 0.28818926 0.28746523 0.3019460
#> 5 s 5 (Intercept) 0.05833502 0.03342223 0.3539464
#> 6 s 6 (Intercept) 0.08108947 0.08478943 0.2049882
```

``` r
Expand Down Expand Up @@ -350,11 +359,11 @@ impSim <- REimpact(m1, InstEval[7, ], groupFctr = "d", breaks = 5,
#> Warning: executing %dopar% sequentially: no parallel backend registered
impSim
#> case bin AvgFit AvgFitSE nobs
#> 1 1 1 2.777249 2.863249e-04 193
#> 2 1 2 3.247372 6.770648e-05 240
#> 3 1 3 3.546850 5.480821e-05 254
#> 4 1 4 3.817535 6.531969e-05 265
#> 5 1 5 4.216303 2.176350e-04 176
#> 1 1 1 2.775244 2.889334e-04 193
#> 2 1 2 3.251612 5.378474e-05 240
#> 3 1 3 3.535261 5.204943e-05 254
#> 4 1 4 3.834013 6.310989e-05 265
#> 5 1 5 4.220246 1.859937e-04 176
```

The result of `REimpact` shows the change in the `yhat` as the case we
Expand Down
Binary file modified man/figures/README_FEsimPlot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_reImpactplot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_reSimplot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_substImpactPredict-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_unnamed-chunk-14-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_unnamed-chunk-7-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README_unnamed-chunk-8-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 475e0b4

Please sign in to comment.