diff --git a/build/make_example.r b/build/make_example.r deleted file mode 100644 index 5815b05..0000000 --- a/build/make_example.r +++ /dev/null @@ -1,31 +0,0 @@ -# reproducible: -set.seed(123) - -# cts and categorical predictors: -x <- rep(1:10, times=3) -g <- as.factor(rep(c('a', 'b', 'c'), each=10)) - -# parameters -a <- 10 -b <- -0.25 -s <- 1 -r <- 3 - -# random effects: -re <- rnorm(nlevels(g), 0, r) -names(re) <- levels(g) - -# linear response -y <- a + b*x + re[g] + rnorm(length(x), 0, s) - -# poisson response: -lambda <- exp((a + b*x + re[g])/10) -z <- rpois(length(x), lambda) - - - - - -example <- data.frame(y=y, x=x, g=g, z=z) -save(example, file='data/example.rda') - diff --git a/build/make_simdata.r b/build/make_simdata.r index 34ad914..78fa94c 100644 --- a/build/make_simdata.r +++ b/build/make_simdata.r @@ -27,5 +27,5 @@ z <- rpois(length(x), lambda) simdata <- data.frame(y=y, x=x, g=g, z=z) -save(example, file='data/simdata.rda') +save(simdata, file='data/simdata.rda') diff --git a/data/example.rda b/data/example.rda deleted file mode 100644 index a4d11b8..0000000 Binary files a/data/example.rda and /dev/null differ diff --git a/data/simdata.rda b/data/simdata.rda index 2f4a785..6203719 100644 Binary files a/data/simdata.rda and b/data/simdata.rda differ diff --git a/vignettes/examples.Rmd b/vignettes/examples.Rmd index 64d7cd9..a50f553 100644 --- a/vignettes/examples.Rmd +++ b/vignettes/examples.Rmd @@ -13,11 +13,11 @@ simrOptions(nsim=25, progress=FALSE, observedPowerWarning=FALSE) This vignette provides examples of some of the hypothesis tests that can be specified in `simr`. The function `doTest` can be used to apply a test to an input model, which lets you check that the test works before running a power simulation. -Documentation for the test specification functions can be found in the online help at `?tests`. +Documentation for the test specification functions can be found in the help system at `?tests`. ## Binomial GLMM with a categorical predictor -The first example comes from the online help for `glmer`. The data frame `cbpp` contains data on contagious bovine pleuropneumonia. An observation variable is added to allow for overdispersion. Note that the response is specified using `cbind` --- `simr` expects a binomial model to be in this form. +The first example comes from the help page for `glmer`. The data frame `cbpp` contains data on contagious bovine pleuropneumonia. An observation variable is added to allow for overdispersion. Note that the response is specified using `cbind` --- `simr` expects a binomial model to be in this form. ```{r} cbpp$obs <- 1:nrow(cbpp)