diff --git a/R/glm.cmp.R b/R/glm.cmp.R index 118ec75..9ef92bf 100644 --- a/R/glm.cmp.R +++ b/R/glm.cmp.R @@ -135,7 +135,7 @@ #' M.attendance <- glm.cmp(daysabs~ gender+math+prog, data=attendance) #' M.attendance #' summary(M.attendance) -#' \donttest{autoplot(M.attendance) # or plot(M.attendance) +#' \donttest{plot(M.attendance) # or autoplot(M.attendance) #' } #' #' ### Ribeiro et al. (2013): Varying dispersion as a function of covariates diff --git a/R/mpcmp-package.R b/R/mpcmp-package.R index bcefecd..e0afd34 100644 --- a/R/mpcmp-package.R +++ b/R/mpcmp-package.R @@ -93,7 +93,7 @@ NULL #' + bidprem + insthold + size + sizesq + regulatn, data=takeoverbids) #' M.bids #' summary(M.bids) -#' autoplot(M.bids) #or plot(M.bids) +#' plot(M.bids) #or autoplot(M.bids) #' NULL diff --git a/cran-comments.md b/cran-comments.md index 49f6564..7b8f816 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,31 +1,35 @@ ## Test environments * local R installation, R 4.0.2 -* ubuntu 16.04 (on travis-ci), R 4.0.2 -* ubuntu 16.04, Windows, macOS (on GitHub Actions), R 4.0.2 -* win-builder (devel and release) +* ubuntu 16.04 (on travis-ci), R 4.0.3 +* ubuntu 16.04, Windows, macOS (on GitHub Actions), R 4.0.3 +* win-builder (devel and release) -## R CMD check results +This is a patch submission to fix some issues picked up by CRAN checks. -There were no ERRORs or WARNINGs. +## R CMD check results -There was 1 NOTE: +0 errors | 0 warnings | 0 notes -* checking CRAN incoming feasibility ... NOTE - Maintainer: ‘Thomas Fung ’ - - New maintainer: - Thomas Fung - Old maintainer(s): - Thomas Fung +Errors and notes from previous submission. -The maintainer changed his email address. +Version: 0.3.5 +Check: dependencies in R code +Result: NOTE + Namespace in Imports field not imported from: ‘broom’ + All declared Imports should be used. +Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-release-macos-x86_64, r-oldrel-macos-x86_64 -There are some issues with the ubuntu 16.04 check via GitHub actions: -"Failed to get R 4.0.3: Failed to get R 4.0.3" but it passes the checks on travis-ci. +* Moved `broom` to the `Suggests` field in Description. -## Downstream dependency. +Version: 0.3.5 +Check: whether package can be installed +Result: ERROR + Installation failed. +Flavor: r-patched-solaris-x86 -There are currently no downstream dependencies for this package. +* Cast integer to double for log function in Rcpp code. This should fix the solaris issue. +## Downstream dependency. +There are currently no downstream dependencies for this package. diff --git a/man/glm.cmp.Rd b/man/glm.cmp.Rd index 2a5ffb2..6304d77 100644 --- a/man/glm.cmp.Rd +++ b/man/glm.cmp.Rd @@ -155,7 +155,7 @@ data(attendance) M.attendance <- glm.cmp(daysabs~ gender+math+prog, data=attendance) M.attendance summary(M.attendance) -\donttest{autoplot(M.attendance) # or plot(M.attendance) +\donttest{plot(M.attendance) # or autoplot(M.attendance) } ### Ribeiro et al. (2013): Varying dispersion as a function of covariates diff --git a/man/takeoverbids.Rd b/man/takeoverbids.Rd index 64d1dc3..66fac4e 100644 --- a/man/takeoverbids.Rd +++ b/man/takeoverbids.Rd @@ -46,7 +46,7 @@ M.bids <- glm.cmp(numbids ~ leglrest + rearest + finrest + whtknght + bidprem + insthold + size + sizesq + regulatn, data=takeoverbids) M.bids summary(M.bids) -autoplot(M.bids) #or plot(M.bids) +plot(M.bids) #or autoplot(M.bids) } \references{ diff --git a/vignettes/mpcmp.Rmd b/vignettes/mpcmp.Rmd index 0c79498..b85283c 100644 --- a/vignettes/mpcmp.Rmd +++ b/vignettes/mpcmp.Rmd @@ -165,7 +165,7 @@ methods(class = "cmp") ## Constant Underdispersion Example: `takeoverbids` -A dataset from @Cameron1997a that gives the number of bids received by 126 US firms that were successful targets of tender offers during the period 1978-85. The dataset comes with a set of explanatory variables such as defensive actions taken by management of target firm, firm-specific characteristics and intervention by federal regulators. +One of the key strength of the CMP distribution is that it can handle underdispersion. Here is an example demonstrating that. A dataset from @Cameron1997a that gives the number of bids received by 126 US firms that were successful targets of tender offers during the period 1978-85. The dataset comes with a set of explanatory variables such as defensive actions taken by management of target firm, firm-specific characteristics and intervention by federal regulators. If we fit a Poisson distribution to the marginal distribution of the number of bids, we have: ```{r} @@ -179,7 +179,7 @@ ggplot(takeoverbids) + colour = "red") + labs(title = "Number of bids with Poisson fit", y = "Probability") ``` -We can see that the response variable is more concentrated than a Poisson fit suggests which is a sign of underdispersion. +We can see that the response variable is more concentrated than a Poisson fit, which is a sign of underdispersion. Here, we can use `glm.cmp()` to fit the mean-parametrized CMP model to try to account for that underdispersion. ```{r} @@ -188,7 +188,7 @@ M.bids <- glm.cmp(numbids ~ leglrest + rearest + finrest + whtknght tidy(M.bids) LRTnu(M.bids) ``` -From the likelihood ratio test, we can see that the dispersion parameter is significantly differnet to 1, suggesting the model is trying to account for that underdispersion. +From the likelihood ratio test, we can see that the dispersion parameter is significantly different to 1, suggesting the model is trying to account for that underdispersion. We can also compare the results with a Poisson model. ```{r}