From 29e376076d14c40cbb82252a6ece24d27e355828 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Oct 2015 17:01:25 +1300 Subject: [PATCH] fix simdata rename; examples.Rmd typos --- build/make_example.r | 31 ------------------------------- build/make_simdata.r | 2 +- data/example.rda | Bin 495 -> 0 bytes data/simdata.rda | Bin 495 -> 493 bytes vignettes/examples.Rmd | 4 ++-- 5 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 build/make_example.r delete mode 100644 data/example.rda 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 a4d11b847811da5c70b8d2fb09b7aa47f9a52692..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 495 zcmV+}2eWT{QIc^`3YUHN z;tY?2LgVeg^&Z6zDjOrtO%=;>P@Efa(&^J}2Z?wQZM}=n928l*mZ>#4ImkpDTwt;! z#zEqHVbubk2@cY+8*HaGayy7Cxu`bG_IJ=u`F+tmGS5LfF4<+*FuzSzw;3gfS{$jC2^I3e5n{qWp3_m?0paF*N{* l|Ns9#f+%GEj}{hODTyVCdTB*KEzt1z2LR=vG{mL@006z6{RWn%5-(mz3|}&JHs)b9eT@{85jU>a1c!Z 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)