Skip to content

Commit

Permalink
version 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hojsgaard authored and cran-robot committed Jan 19, 2023
1 parent 09b74e6 commit d5120bb
Show file tree
Hide file tree
Showing 57 changed files with 2,742 additions and 1,743 deletions.
37 changes: 17 additions & 20 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: pbkrtest
Version: 0.5.1
Version: 0.5.2
Title: Parametric Bootstrap, Kenward-Roger and Satterthwaite Based
Methods for Test in Mixed Models
Authors@R: c(
Expand All @@ -9,31 +9,28 @@ Authors@R: c(
email = "sorenh@math.aau.dk", role = c("aut", "cre", "cph"))
)
Maintainer: Søren Højsgaard <sorenh@math.aau.dk>
Description: Test in mixed effects models. Attention is on mixed
effects models as implemented in the 'lme4' package. For linear
mixed models, this package implements (1) a parametric bootstrap
test, (2) a Kenward-Roger-typ modification of F-tests for linear
mixed effects models and (3) a Satterthwaite-type modification of
F-tests for linear mixed effects models. The package also
implements a parametric bootstrap test for generalized linear
mixed models. The facilities of the package are documented in the
paper by Halehoh and Højsgaard, (2012,
<doi:10.18637/jss.v059.i09>). Please see 'citation("pbkrtest")'
for citation details.
Description: Computes p-values based on (a) Satterthwaite or
Kenward-Rogers degree of freedom methods and (b) parametric bootstrap
for mixed effects models as implemented in the 'lme4'
package. Implements parametric bootstrap test for generalized linear
mixed models as implemented in 'lme4' and generalized linear
models. The package is documented in the paper by Halekoh and
Højsgaard, (2012, <doi:10.18637/jss.v059.i09>). Please see
'citation("pbkrtest")' for citation details.
URL: https://people.math.aau.dk/~sorenh/software/pbkrtest/
Depends: R (>= 3.5.0), lme4 (>= 1.1.10)
Imports: broom, dplyr, magrittr, MASS, Matrix (>= 1.2.3), methods,
numDeriv, parallel, knitr
Depends: R (>= 4.1.0), lme4 (>= 1.1.31)
Imports: broom, dplyr, MASS, Matrix (>= 1.2.3), methods, numDeriv,
parallel
Suggests: knitr
Encoding: UTF-8
ZipData: no
VignetteBuilder: knitr
License: GPL (>= 2)
ByteCompile: Yes
RoxygenNote: 7.1.1
RoxygenNote: 7.2.3
LazyData: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2021-03-09 07:41:11 UTC; sorenh
Packaged: 2023-01-19 07:09:26 UTC; sorenh
Author: Ulrich Halekoh [aut, cph],
Søren Højsgaard [aut, cre, cph]
Repository: CRAN
Date/Publication: 2021-03-09 09:50:08 UTC
Date/Publication: 2023-01-19 18:00:10 UTC
93 changes: 48 additions & 45 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
3279c01f6caf536d363ded574523fef7 *ChangeLog
76bdb6ee388fe2d650941eb138b76263 *DESCRIPTION
6c9c5588ac5473db103c8de04338c904 *NAMESPACE
573e765dbaf9b92e72c2167fb561d8a2 *NEWS
015d4f88f384871659053b52d378b962 *R/KR-Sigma-G2.R
553b180594e4725165bb4fbc3e30e87e *DESCRIPTION
1f40bf9b45d5cf74f3d04c008bf37575 *NAMESPACE
be5fdb17f326d444ad4592b54916c6ce *NEWS
0b7b5f834a5bda641fe0b55a08356513 *R/KR-Sigma-G2.R
7f17aca2b6550f68b23c2faff800c3f8 *R/KR-across-versions.R
4babf9bf83a39ae02f42fb49d9f3c0dc *R/KR-modcomp.R
e7f296cc5ecdbcbf583f9cea74b6245a *R/KR-utils.R
9cf9db472f6f3a5799e67439b3808d0e *R/KR-vcovAdj.R
2811cf1b83de66252b5ef6411c6f8b42 *R/NAMESPACE.R
5fb3a6458ff6279a9e32dc6909d3cf58 *R/PB-modcomp.R
896258c23ba2fdd6d7dcda164747dbea *R/PB-refdist.R
0b7feed23b7c977e4066547c0fe92d6b *R/PB-utils.R
9c1bac981405d1bf18a48f1c3218e8b5 *R/SAT-modcomp.R
be8744773b3d0dbb9ebc4957921a54bf *R/data-beets.R
94d64fd2f1ca6c7cb800ed79522fed60 *R/data-budworm.R
1af8640e29be21efe84e65dccd908134 *R/getKR.R
5d1e277317ad81d659e16d37dd15ef89 *R/get_ddf_Lb.R
4776f35d0573157ce483bc44521e21d0 *R/init-modcomp.R
96415b1894fcad7a94222fadf028244a *R/internal-pbkrtest.R
9cbb49cf272cab01cddea35fdad9a313 *R/model-coerce.R
8863ab7f8803aaabe3ffe28b6cfbf82a *README.md
3e926d66211ab80c66456fdc8612e731 *build/vignette.rds
c58b3a21b870530b98120a397f41f38d *R/KR-modcomp.R
e565cf3384e961ab98e7199a838d9ee2 *R/KR-utils.R
02e6835edcd6aa83d4b081ee64eb1227 *R/KR-vcovAdj.R
9584efc058023d75073d368d2ed2654d *R/NAMESPACE-pbkrtest.R
8c8c56e9abdccddf66f9ecbd15989fe9 *R/PB-modcomp.R
7742d6df36bb2dacdf3b141f02baf4a4 *R/PB-refdist.R
1b0a0f99a44f16836946114c331aa5ee *R/PB-utils.R
a3be8c961d464993ebd0dcec664ab397 *R/SAT-modcomp.R
83cfd1cc047607ed669f1036b8e810de *R/data-beets.R
135c5f9c4d4e4fd499cd6cee3e23ea2d *R/data-budworm.R
7cc46f7e57400bbb3e292a4768871848 *R/getKR.R
1b5009adf3cc565ea38af7ecab9a7e8d *R/get_ddf_Lb.R
fc2da0cd568fe69204e50cb09f84d711 *R/init-modcomp.R
ae9dbf94511ebae28835be23a2b59b29 *R/internal-pbkrtest.R
20fa5a92bd482fb9a4c5307e92569695 *R/model-coerce.R
460a524ca9a754631a9c491599d0311b *R/utilities.R
7fda9e53a0c4fd1d49bef84982f2b1d7 *README.md
22b613238a9499bad714ffcfabdfb77c *build/vignette.rds
25a3a55d27aa15aa5472e6fc4d10310d *data/beets.RData
0bf3e5202394edbc9390961036629ad1 *data/budworm.RData
2f0435596b9735ee0852c2d135281569 *inst/CITATION
a1f073d2a8539678ee0ee0f79184178d *inst/doc/coercion.R
46fc1f3ccebd87ff0988272385282ca2 *inst/doc/coercion.Rnw
efb4ffd229ff9963390e1031d2007f25 *inst/doc/coercion.pdf
763cbfbf07cc25c593f104b1b5cb4b41 *inst/doc/pbkrtest.R
56750b6576c3a6c4fe8484b5aedbfeff *inst/doc/pbkrtest.Rnw
9c9620cef64f7aa61f3a67f550a1db7f *inst/doc/pbkrtest.pdf
cd74378c3f739073feea6d88dc38fc18 *man/compute_auxillary.Rd
3f2dd16922eff9acf1da8c0cb05b0c2b *man/data-beets.Rd
1b5ad0a8036bad4511136fcb5120ed0d *man/data-budworm.Rd
6cbc3b21441a255670e66e0190ee92b2 *man/devfun_vp.Rd
10c50cfe579d9ea6bf4d0011ce7ed371 *man/get_Fstat_ddf.Rd
5d0b2785821736471c7ffdae8227bb6b *man/get_covbeta.Rd
a47be8efd68bf4d303ba0ded6cea4ecd *man/get_ddf_Lb.Rd
7b89f7ee32cd21f0c1cf5563f319e34e *man/getkr.Rd
b46405368093f698931e9b0ea81ff962 *man/internal-pbkrtest.Rd
e8186025e845c03cf0879ab080e18d1f *man/internal.Rd
2345791082137beb3bc5ec8d481e6190 *man/kr-modcomp.Rd
1dc8efe9da169af8d16a7dd9a08e38e1 *man/kr-vcov.Rd
ab4d97d8dfb5b26297e8a5806f49c28c *man/model-coerce.Rd
0a72ac8927ba191825054400b62b3095 *man/pb-modcomp.Rd
34496b88e1b3786b5cd8eb0d83a669fa *man/pb-refdist.Rd
5168806858a1173f871871d3b119830e *man/sat-modcomp.Rd
46fc1f3ccebd87ff0988272385282ca2 *vignettes/coercion.Rnw
56750b6576c3a6c4fe8484b5aedbfeff *vignettes/pbkrtest.Rnw
e09c85aa411e04badc0a6c9a7279e8b2 *inst/WORDLIST
e7dff7723ccf47ded812bfcdaa07f78e *inst/doc/a01-pbkrtest.R
aecbeb724049cf311bd21a17815143cb *inst/doc/a01-pbkrtest.html
3622cceae54af2d0fa6a6f2214c3ca67 *inst/doc/a01-pbkrtest.rmd
ca7dd9e98be995bea8b29d4e3556a908 *inst/doc/a02-coercion.R
062425d1bb44f2db0075f3bc47b44514 *inst/doc/a02-coercion.html
ba7121c845079e0be2bf49a6560d7de4 *inst/doc/a02-coercion.rmd
739c8d108bc9661ac1a37592252d5be8 *man/compare_column_space.Rd
faf456dd438f7e96fe3b27ee1dd62795 *man/compute_auxiliary.Rd
cb6e5969cf66ced75c9ea006dafa3139 *man/data-beets.Rd
344038481b6ba6cec17fa88b1a8eba0a *man/data-budworm.Rd
4bfd983c89bfc167cc9cc75402d8e0ea *man/devfun_vp.Rd
195d81b5540da86be88a9e6c9b0e7776 *man/get_Fstat_ddf.Rd
792124d0b42f0bbb1268ebf26ed97453 *man/get_covbeta.Rd
366d0b5abd29fc829e0c9b4cf315ef23 *man/get_ddf_Lb.Rd
a6a52280f51827e74a134de830503797 *man/get_modcomp.Rd
7d06f8c38cb2c10d98542c40c04ff3a9 *man/internal-pbkrtest.Rd
7e9bb07603f61359b04fe87509bf1abc *man/internal.Rd
eb94c9f1cd6acfdc8a3044802bcc6e5a *man/kr-modcomp.Rd
80e47e5ae135404d1f3940a54dc00a0a *man/kr-vcovAdj.Rd
e5a7a07032e69307fd55d16cc0c9899a *man/model-coerce.Rd
2ed5bf6edf2f76b0cb1c2e4bc6fb02d1 *man/pb-modcomp.Rd
0487620876b059ea8e057bed5fc09383 *man/pb-refdist.Rd
32bc75ff6d555e129e073f069fa8ee33 *man/sat-modcomp.Rd
3622cceae54af2d0fa6a6f2214c3ca67 *vignettes/a01-pbkrtest.rmd
ba7121c845079e0be2bf49a6560d7de4 *vignettes/a02-coercion.rmd
33 changes: 20 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,47 @@ S3method(as.data.frame,KRmodcomp)
S3method(as.data.frame,PBmodcomp)
S3method(as.data.frame,SATmodcomp)
S3method(as.data.frame,XXmodcomp)
S3method(getLRT,glmerMod)
S3method(getLRT,lm)
S3method(getLRT,lmerMod)
S3method(get_Lb_ddf,lmerMod)
S3method(get_SigmaG,lmerMod)
S3method(model2remat,default)
S3method(model2remat,lm)
S3method(model2remat,merMod)
S3method(model2restriction_matrix,default)
S3method(model2restriction_matrix,lm)
S3method(model2restriction_matrix,merMod)
S3method(plot,PBmodcomp)
S3method(print,KRmodcomp)
S3method(print,PBmodcomp)
S3method(print,SATmodcomp)
S3method(print,summaryPB)
S3method(remat2model,default)
S3method(remat2model,lm)
S3method(remat2model,merMod)
S3method(print,summary_PBmodcomp)
S3method(restriction_matrix2model,default)
S3method(restriction_matrix2model,glmerMod)
S3method(restriction_matrix2model,lm)
S3method(restriction_matrix2model,lmerMod)
S3method(summary,KRmodcomp)
S3method(summary,PBmodcomp)
S3method(tidy,KRmodcomp)
S3method(tidy,PBmodcomp)
S3method(tidy,SATmodcomp)
S3method(tidy,summary_KRmodcomp)
S3method(tidy,summary_PBmodcomp)
S3method(vcovAdj,lmerMod)
export("%>%")
export(KRmodcomp)
export(Lb_ddf)
export(PBmodcomp)
export(PBrefdist)
export(SATmodcomp)
export(compare_column_space)
export(ddf_Lb)
export(getKR)
export(getLRT)
export(getSAT)
export(get_Lb_ddf)
export(get_SigmaG)
export(make_modelmat)
export(make_remat)
export(model2remat)
export(remat2model)
export(make_model_matrix)
export(make_restriction_matrix)
export(model2restriction_matrix)
export(restriction_matrix2model)
export(tidy)
export(vcovAdj)
export(vcovAdj.lmerMod)
Expand All @@ -58,7 +66,6 @@ importFrom(graphics,abline)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,plot)
importFrom(magrittr,"%>%")
importFrom(methods,as)
importFrom(methods,is)
importFrom(parallel,clusterCall)
Expand Down
21 changes: 17 additions & 4 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
pbkrtest v0.5.1 (Release date: 2021-03-09)
pbkrtest 0.5.2 (Release date: 2023-01-19)
============================================

Changes

* remat changed to restriction_matrix for increased readability
* WORDLIST file added
* Changes in reference to JSS paper
* Various changes in documentation
* Satterthwaite approximation now illustrated in vignette
* Fixed bug in computation of LRTstatistic. Thanks to Helle Sorensen for pointing it out.


pbkrtest 0.5.1 (Release date: 2021-03-09)
============================================

Changes

* Improved documentation

pbkrtest v0.5-0.0 (Release date: 2020-08-04)
pbkrtest 0.5-0.0 (Release date: 2020-08-04)
============================================

Changes
Expand All @@ -19,7 +32,7 @@ Changes
* doi added to DESCRIPTION file


pbkrtest v0.4-8.6 (Release date: 2020-02-20)
pbkrtest 0.4-8.6 (Release date: 2020-02-20)
============================================

Bug fixes:
Expand All @@ -32,7 +45,7 @@ Bug fixes:
to make emmeans used generic function vcovAdj.


pbkrtest v0.4-8 (Release date: 2020-02-20)
pbkrtest 0.4-8 (Release date: 2020-02-20)
==========================================

Bug fixes:
Expand Down
72 changes: 36 additions & 36 deletions R/KR-Sigma-G2.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,43 +112,43 @@ get_SigmaG.lmerMod <- function(object, details=0) {
## Modular implementation
##

.get_GI_parms <- function( object ){
GGamma <- VarCorr(object)
parmList <- lapply(GGamma, function(Lii){ Lii[ lower.tri( Lii, diag=TRUE ) ] })
parmList <- c( parmList, sigma( object )^2 )
parmList
}

.get_GI_matrices <- function( object ){

SS <- .shgetME( object )
Zt <- getME( object, "Zt" )

G <- NULL
G <- vector("list", SS$n.RT+1)
## .get_GI_parms <- function( object ){
## GGamma <- VarCorr(object)
## parmList <- lapply(GGamma, function(Lii){ Lii[ lower.tri( Lii, diag=TRUE ) ] })
## parmList <- c( parmList, sigma( object )^2 )
## parmList
## }

for (ss in 1:SS$n.RT) {
ZZ <- .shget_Zt_group( ss, Zt, SS$Gp )
n.lev <- SS$n.lev.by.RT2[ ss ] ## ; cat(sprintf("n.lev=%i\n", n.lev))
Ig <- sparseMatrix(1:n.lev, 1:n.lev, x=1)
UU <- vector("list", SS$n.parm.by.RT)
for (rr in 1:SS$n.parm.by.RT[ ss ]) {
ii.jj <- .index2UpperTriEntry( rr, SS$n.comp.by.RT[ ss ] )
ii.jj <- unique(ii.jj)
if (length(ii.jj)==1){
EE <- sparseMatrix(ii.jj, ii.jj, x=1, dims=rep(SS$n.comp.by.RT[ ss ], 2))
} else {
EE <- sparseMatrix(ii.jj, ii.jj[2:1], dims=rep(SS$n.comp.by.RT[ ss ], 2))
}
EE <- Ig %x% EE ## Kronecker product
UU[[ rr ]] <- t(ZZ) %*% EE %*% ZZ
}
G[[ ss ]] <- UU
}
n.obs <- nrow(getME(object,'X'))
G[[ length( G ) ]] <- sparseMatrix(1:n.obs, 1:n.obs, x=1 )
G
}
## .get_GI_matrices <- function( object ){

## SS <- .shgetME( object )
## Zt <- getME( object, "Zt" )

## G <- NULL
## G <- vector("list", SS$n.RT+1)

## for (ss in 1:SS$n.RT) {
## ZZ <- .shget_Zt_group( ss, Zt, SS$Gp )
## n.lev <- SS$n.lev.by.RT2[ ss ] ## ; cat(sprintf("n.lev=%i\n", n.lev))
## Ig <- sparseMatrix(1:n.lev, 1:n.lev, x=1)
## UU <- vector("list", SS$n.parm.by.RT)
## for (rr in 1:SS$n.parm.by.RT[ ss ]) {
## ii.jj <- .index2UpperTriEntry( rr, SS$n.comp.by.RT[ ss ] )
## ii.jj <- unique(ii.jj)
## if (length(ii.jj)==1){
## EE <- sparseMatrix(ii.jj, ii.jj, x=1, dims=rep(SS$n.comp.by.RT[ ss ], 2))
## } else {
## EE <- sparseMatrix(ii.jj, ii.jj[2:1], dims=rep(SS$n.comp.by.RT[ ss ], 2))
## }
## EE <- Ig %x% EE ## Kronecker product
## UU[[ rr ]] <- t(ZZ) %*% EE %*% ZZ
## }
## G[[ ss ]] <- UU
## }
## n.obs <- nrow(getME(object,'X'))
## G[[ length( G ) ]] <- sparseMatrix(1:n.obs, 1:n.obs, x=1 )
## G
## }



Expand Down
Loading

0 comments on commit d5120bb

Please sign in to comment.