Skip to content

Commit

Permalink
version 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpkeil1 authored and cran-robot committed Sep 9, 2020
1 parent 98e1efc commit 74929d9
Show file tree
Hide file tree
Showing 16 changed files with 724 additions and 267 deletions.
13 changes: 6 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: qgcomp
Title: Quantile G-Computation
Version: 2.4.0
Date: 2020-06-30
Version: 2.5.0
Date: 2020-09-09
Authors@R:
person(given = "Alexander",
family = "Keil",
Expand All @@ -22,15 +22,14 @@ Description: G-computation for a set of time-fixed exposures
License: GPL (>= 2)
Depends: R (>= 3.5.0)
Imports: arm, future, future.apply, generics, ggplot2 (>= 3.3.0),
grDevices, grid, gridExtra, markdown, pscl, stats, survival,
tibble
Suggests: broom, devtools, knitr, MASS, mice
grDevices, grid, gridExtra, pscl, stats, survival, tibble
Suggests: broom, devtools, knitr, markdown, MASS, mice
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.1.0
NeedsCompilation: no
Packaged: 2020-06-30 14:48:08 UTC; akeil
Packaged: 2020-09-09 20:14:41 UTC; akeil
Repository: CRAN
Date/Publication: 2020-07-01 12:00:02 UTC
Date/Publication: 2020-09-09 21:10:02 UTC
29 changes: 15 additions & 14 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
54b3bba6855f77d80fca65c781165cf5 *DESCRIPTION
073739eee06262e364f4075ad953eb9b *NAMESPACE
5580971ea7350678ac3f9c4f8776506c *NEWS.md
4eb3aed48c06acea8e2c8660f1022eb8 *R/base.R
59b2aa8138a143410777d47266c75014 *R/base_experimental.R
c88b954630a8f22f5d8179f1903fb69a *DESCRIPTION
5c0ca86a68f6d1e1d79def765019ca3b *NAMESPACE
99dc623c9e742de0037e0ed999be0d15 *NEWS.md
3c0fdcd4d379d3e7dcdd5ed21b5642eb *R/base.R
ad02dc8706a119714c07e79b625cc3c5 *R/base_experimental.R
a0df8f78bc8073d1ad854ab3e7cc73db *R/base_extensions.R
1e84a548046b0e6e1e22a1cd5763c703 *R/base_hurdle.R
20a484841046871bda3190929148024f *R/base_samplesplits.R
3a4f462c7385b8a3e358525b2b8b8108 *R/base_samplesplits.R
642759c54f0d6ee074d77ba3a21b73bf *R/base_surv.R
bc9851d206fa984b173ebd31de344b5b *R/base_zi.R
d7960ce32c7acf5a10f22eec98357cd5 *R/base_zi.R
c1010c23e7a3ff99d466b057d7a03ea7 *R/data.R
0d1dbf0c04415d35f2b970b3068d093e *R/utility.R
b4f036691ae74daf7ea60623f133b74e *README.md
997ebd99b472c24d1ece722b0a61a8bf *build/vignette.rds
f56192ecbbc72f687edd64504f3fc022 *build/vignette.rds
c52baf72a0ded2860f1fc7bcc0a44587 *data/metals.RData
b9949942e95b261face845ec17947202 *inst/doc/qgcomp-vignette.R
9b1f3218ce75857ff980df947b104247 *inst/doc/qgcomp-vignette.Rmd
013703f4d641ca29f30a76e798dd40e9 *inst/doc/qgcomp-vignette.html
243107595af80126cbf287ba757bfea0 *inst/doc/qgcomp-vignette.R
f521e935785bf2cc4df98b8c8388ea41 *inst/doc/qgcomp-vignette.Rmd
fc7d5d3b1031b9fb09d23758d76a7996 *inst/doc/qgcomp-vignette.html
a02edf3220edb6948da5a4836a5dcee8 *inst/fig/res1.png
003c6012f034846de2c7632492689e40 *inst/fig/res2.png
512f3658c7c00e503fd311e66ba9e191 *inst/fig/res4.png
Expand All @@ -34,7 +34,7 @@ e03bf2686ec795d743c27e2eb16979e4 *man/msm.predict.Rd
6c915ac3229dc2269b0225aaba829701 *man/plot.qgcompfit.Rd
a626c34a69dc156f77b7ba09f023be3a *man/pointwisebound.boot.Rd
02328aab58b9acf5e5d0d142b2c71ae3 *man/pointwisebound.noboot.Rd
e0627a131926081baaeb470b729523d5 *man/predict.qgcompfit.Rd
08f3c82fdf02a07a234439568fb1d81e *man/predict.qgcompfit.Rd
2ec93c35a8e9e4352baa7af40e0624cd *man/print.qgcompfit.Rd
962bafb313e364d995bcf5bdec95cde5 *man/qgcomp.Rd
346474c8f3c156276b1d5e7942b29d0a *man/qgcomp.boot.Rd
Expand All @@ -43,11 +43,12 @@ f643c4b9deece81d37b45bd068e51911 *man/qgcomp.cox.boot.Rd
fa41baa40dfb14e82a36159f8e2d1ce7 *man/qgcomp.hurdle.boot.Rd
1418f7d295a1d046cd8e932b6b82f006 *man/qgcomp.hurdle.noboot.Rd
e2f718fa211e54f61c24d79759091a30 *man/qgcomp.noboot.Rd
dd550b82cc350a9459b3b0da76c62e4e *man/qgcomp.partials.Rd
03ce9a53a89a689cde9a0f38acfc853c *man/qgcomp.partials.Rd
9eb3ea4ebe57192b24ff64b598bbb9de *man/qgcomp.zi.boot.Rd
272ff788437b05b20ee98ba277f0e37f *man/qgcomp.zi.noboot.Rd
6fb9d04399b8f54a3ed6fb81184f435b *man/quantize.Rd
44f62347f5120c804a8b7bc09c09958d *man/se_comb.Rd
44b3a8d8532b85fe44ee825a2ac00139 *man/split_data.Rd
ce81e1ffbeb2e8f4d0ebda7b11e2156f *man/tidy.qgcompfit.Rd
a29ffa5384b6693939825d9f086e0b70 *man/vc_comb.Rd
7bd0f5b05cbf350d9fbe41037df843ba *man/zimsm.fit.Rd
Expand All @@ -66,4 +67,4 @@ cecfcbc8fadd679bed648d6cf387fe42 *tests/test_factor.R
055d4f8d4b83a240f614fb268ffb5dbe *tests/test_weights.R
9d6641dc4618806fd84bdbfc65f2c97d *tests/test_zi.R
0c404d7d4543c0a61f2d7c46f1dbbeab *tests/test_zzzplots.R
9b1f3218ce75857ff980df947b104247 *vignettes/qgcomp-vignette.Rmd
f521e935785bf2cc4df98b8c8388ea41 *vignettes/qgcomp-vignette.Rmd
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ export(qgcomp.partials)
export(qgcomp.zi.boot)
export(qgcomp.zi.noboot)
export(quantize)
export(split_data)
export(zimsm.fit.control)
import(arm)
import(ggplot2)
import(grDevices)
import(grid)
import(gridExtra)
import(pscl)
import(stats)
import(survival)
importFrom(generics,glance)
importFrom(generics,tidy)
importFrom(grDevices,gray)
importFrom(stats,AIC)
importFrom(stats,BIC)
importFrom(stats,anova)
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# qgcomp v2.5.0
## Major changes
- Documentation improvements
- Added `split_data` function to assist with inference from data adaptive procedures (such as qgcomp.partials) and model selection

## Minor changes
- Removed "experimental" tags on Poisson family, Zero inflated models
- Added smarter "expnms" default to `predict.qgcompfit` function with new data

# qgcomp v2.4.0
## Major changes
- Documentation improvements
Expand Down
15 changes: 9 additions & 6 deletions R/base.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ quantize <- function (data, expnms, q=4, breaks=NULL) {
if(length(expnms)==1){
data[, expnms] <- qt(1)
}else{
data[, expnms] <- sapply(1:length(expnms), qt)
data[, expnms] <- sapply(seq_len(length(expnms)), qt)
}
return(list(data=data, breaks=e$retbr))
}
Expand Down Expand Up @@ -1427,7 +1427,7 @@ print.qgcompfit <- function(x, showweights=TRUE, ...){
rnm = c("(Intercept)", c(paste0('psi',1:max(1, length(coef(x))-1))))
}
if (fam == "poisson"){
message("Poisson family still experimental: use with caution")
#message("Poisson family still experimental: use with caution")
estimand <- 'RR'
cat(paste0("Mixture log(",estimand,")", ifelse(x$bootstrap, " (bootstrap CI)", " (Delta method CI)"), ":\n\n"))
testtype = "Z"
Expand Down Expand Up @@ -1477,7 +1477,7 @@ summary.qgcompfit <- function(object, ...){
rnm = c("(Intercept)", c(paste0('psi',1:max(1, length(coef(object))-1))))
}
if (fam == "poisson"){
message("Poisson family still experimental: use with caution")
#message("Poisson family still experimental: use with caution")
estimand <- 'RR'
cat(paste0("Mixture log(",estimand,")", ifelse(object$bootstrap, " (bootstrap CI)", " (Delta method CI)"), ":\n\n"))
testtype = "Z"
Expand Down Expand Up @@ -1552,6 +1552,7 @@ plot.qgcompfit <- function(x,
#' @param ... unused
#' @seealso \code{\link[qgcomp]{qgcomp.noboot}}, \code{\link[qgcomp]{qgcomp.boot}}, and \code{\link[qgcomp]{qgcomp}}
#' @import ggplot2 grid gridExtra
#' @importFrom grDevices gray
#' @export
#' @examples
#' set.seed(12)
Expand Down Expand Up @@ -1963,9 +1964,11 @@ predict.qgcompfit <- function(object, expnms=NULL, newdata=NULL, type="response"
#'
#' @description get predicted values from a qgcompfit object, or make predictions
#' in a new set of data based on the qgcompfit object. Note that when making predictions
#' from an object from qgcomp.boot, the predictions are made from the g-computation
#' from an object from qgcomp.boot, the predictions are made from the (conditional) g-computation
#' model rather than the marginal structural model. Predictions from the marginal
#' structural model can be obtained via \code{\link[qgcomp]{msm.predict}}
#' structural model can be obtained via \code{\link[qgcomp]{msm.predict}}. Note
#' that this function accepts non-quantized exposures in "newdata" and automatically
#' quantizes them according to the quantile cutpoints in the original fit.
#'
#' @param object "qgcompfit" object from `qgcomp.noboot`, `qgcomp.boot`, `qgcomp.zi.noboot`,
#' or `qgcomp.zi.boot`functions
Expand All @@ -1979,7 +1982,6 @@ predict.qgcompfit <- function(object, expnms=NULL, newdata=NULL, type="response"
#' returns a matrix giving the fitted values of each term in the model formula
#' on the linear predictor scale.
#' @param ... arguments to predict.glm
#' @import grDevices
#' @export
#' @examples
#' set.seed(50)
Expand All @@ -1994,6 +1996,7 @@ predict.qgcompfit <- function(object, expnms=NULL, newdata=NULL, type="response"
pred <- predict(object$fit, type=type, ...)
}
if(!is.null(newdata)){
if(is.null(expnms[1])) expnms = object$expnms # testing
newqdata <- quantize(newdata, expnms, q=NULL, object$breaks)$data
pred <- predict(object$fit, newdata=newqdata, type=type, ...)
}
Expand Down
Loading

0 comments on commit 74929d9

Please sign in to comment.