Skip to content

Commit

Permalink
Fix CRAN CMD NOTE in vigenttes
Browse files Browse the repository at this point in the history
  • Loading branch information
graemeleehickey committed Jan 20, 2025
1 parent 8cfb7f8 commit 475ec87
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

- Add R-hub workflow to enable checks for platforms not covered already.

- Vignettes now force `Sys.setenv("OMP_THREAD_LIMIT" = 1)` and `options(Ncpus = 1)` in a bid to get around CRAN CMD changes.

# joineRML 0.4.6

## Housekeeping
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## R CMD check results

0 errors | 0 warnings | 2 notes
0 errors | 0 warnings | 1 notes

Win-Builder NOTE: "checking CRAN incoming feasibility ... NOTE"

Expand Down
7 changes: 4 additions & 3 deletions vignettes/joineRML-tidy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ library(knitr)
Sys.setenv("OMP_THREAD_LIMIT" = 1)
Sys.setenv("OMP_NUM_THREADS" = 1)
options(Ncpus = 1)
options(cores = 2)
```

# Introduction
Expand All @@ -41,7 +42,7 @@ These methods are specifically useful when plotting results of a joint model or

We use the sample example from the introductory vignette to `joineRML` using the heart valve data.

```{r vignette, eval=FALSE}
```{r vignette, eval=FALSE, purl=FALSE}
vignette("joineRML", package = "joineRML")
help("heart.valve", package = "joineRML")
```
Expand Down Expand Up @@ -99,7 +100,7 @@ tidy(fit, ci = TRUE, conf.level = 0.99)

The standard errors reported by default are based on the empirical information matrix, as in `mjoint`. It is of course possible to use bootstrapped standard errors as follows:

```{r tidy-boot, eval=FALSE}
```{r tidy-boot, eval=FALSE, purl=FALSE}
bSE <- bootSE(fit, nboot = 100, safe.boot = TRUE, progress = FALSE)
tidy(fit, boot_se = bSE, conf.int = TRUE)
```
Expand Down Expand Up @@ -177,6 +178,6 @@ glance(fit2)

Several examples of how to use `broom` including more details are available on its introductory vignette:

```{r vignette-broom, eval = FALSE}
```{r vignette-broom, eval=FALSE, purl=FALSE}
vignette(topic = "broom", package = "broom")
```
15 changes: 8 additions & 7 deletions vignettes/joineRML.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ if (requireNamespace('joineR', quietly = TRUE)) {
Sys.setenv("OMP_THREAD_LIMIT" = 1)
Sys.setenv("OMP_NUM_THREADS" = 1)
options(Ncpus = 1)
options(cores = 2)
```

# Introduction

The `joineRML` package implements methods for analyzing data from *multiple* longitudinal studies in which the responses from each subject consists of time-sequences of repeated measurements and a possibly censored time-to-event outcome. The modelling framework for the repeated measurements is the multivariate linear mixed effects model. The model for the time-to-event outcome is a Cox proportional hazards model with log-Gaussian frailty. Stochastic dependence is captured by allowing the Gaussian random effects of the linear model to be correlated with the frailty term of the Cox proportional hazards model. For full details of the model, please consult the technical vignette by running

```{r vignette, eval=FALSE}
```{r vignette, eval=FALSE, purl=FALSE}
vignette("technical", package = "joineRML")
```

Expand All @@ -41,7 +42,7 @@ vignette("technical", package = "joineRML")

The simplest way to explain the concepts of the package is through an example. `joineRML` comes with the data set `heart.valve`. Details of this data can be found in the help file by running the command

```{r heart.valve_help, eval=FALSE}
```{r heart.valve_help, eval=FALSE, purl=FALSE}
help("heart.valve", package = "joineRML")
```

Expand Down Expand Up @@ -133,21 +134,21 @@ plot(fit, params = "beta")

Once an `mjoint` model has converged, and assuming the `pfs` argument is `TRUE` (default), then approximated standard errors are calculated based on the empirical information matrix of the profile likelihood at the maximizer. Theoretically, these standard errors will be underestimated (see the technical vignette). In principle, residual Monte Carlo error will oppose this through an increase in uncertainty.

```{r hvd_model_boot, eval=FALSE}
```{r hvd_model_boot, eval=FALSE, purl=FALSE}
fit.se <- bootSE(fit, nboot = 100)
```

Bootstrapping is a computationally intensive method, possibly taking many hours to fit. For this reason, one can relax the control parameter constraints on the optimization algorithm for each bootstrap model; however, this will be at the possible expense of inflated standard errors due to Monte Carlo error.

We can call the `bootSE` object to interrogate it

```{r hvd_model_boot_print, eval=FALSE}
```{r hvd_model_boot_print, eval=FALSE, purl=FALSE}
fit.se
```

or alternatively re-run the `summary` command, passing the additional argument of `bootSE = fit.se`

```{r hvd_model_boot_summary, eval=FALSE}
```{r hvd_model_boot_summary, eval=FALSE, purl=FALSE}
summary(fit, bootSE = fit.se)
```

Expand All @@ -171,7 +172,7 @@ To fit a univariate model in `joineR` we run the following code for the `hvd` da
joineR_available <- require(joineR)
```

```{r joineR, cache=TRUE, eval=joineR_available}
```{r joineR, cache=TRUE, eval=joineR_available, purl=joineR_available}
library(joineR, quietly = TRUE)
hvd.surv <- UniqueVariables(hvd, var.col = c("fuyrs", "status"), id.col = "num")
Expand Down Expand Up @@ -207,7 +208,7 @@ summary(fit.joinerml)

In addition to just comparing model parameter estimates, we can also extract the predicted (or posterior) random effects from each model and plot them.

```{r re_comp_plot, fig.width=7.25, fig.height=4, eval=joineR_available}
```{r re_comp_plot, fig.width=7.25, fig.height=4, eval=joineR_available, purl=joineR_available}
id <- as.numeric(row.names(fit.joiner$coefficients$random))
id.ord <- order(id) # joineR rearranges patient ordering during EM fit
par(mfrow = c(1, 2))
Expand Down

0 comments on commit 475ec87

Please sign in to comment.