library(knitr) opts_chunk$set(echo = FALSE, comment = NA)
# Pass arguments dfr <- params$dfr vars <- params$vars trt <- params$trt trt.lab <- params$trt.lab nct <- nchar(trt.lab) trt.lab.s <- paste0(trt.lab, "s") trt.lab.c <- paste0(toupper(substr(trt.lab, 1, 1)), substr(trt.lab, 2, nct)) trt.lab.sc <- paste0(toupper(substr(trt.lab, 1, 1)), substr(trt.lab, 2, nct), "s") rep <- params$rep eu <- params$eu maxp <- params$maxp mc <- params$mc # Get means if subsamples if (!is.null(eu)) { dfr2 <- dfr dfr <- docomp(dfr, "mean", vars, c(trt, eu), rep) } # Check factors structure out <- ck.fs(dfr, trt, rep) dfr <- out$dfr nt <- out$nl[[1]] nrep <- out$nrep nmis.fac <- out$nmis.fac
Data from r nt
r trt.lab.s
have been evaluated using a randomize complete block design with r nrep
blocks. The statistical model is
$$
y_{ij} = \mu + \tau_i + \beta_j + \epsilon_{ij}
$$
where
r trt.lab
$i$ and block $j$.r trt.lab.s
and blocks.r trt.lab
$i$.In this model we assume that the errors are independent and have a normal distribution with common variance, that is, $\epsilon_{ij} \sim N(0,\sigma_{\epsilon}^2)$.
r if (nmis.fac == 1) paste("Note: There is", nmis.fac, "row with missing values for classifications factors. This row has been deleted.")
r if (nmis.fac > 1) paste("Note: There are", nmis.fac, "rows with missing values for classifications factors. These rows have been deleted.")
out <- NULL for (i in 1:length(vars)) { lc <- ck.rcbd(dfr, vars[i], trt, rep) if (lc$ng.0 == 0 & lc$nrep > 1 & lc$ng.mult == 0 & lc$pmis <= maxp) { out <- c(out, knit_expand('child_rcbd.Rmd')) } else { out <- c(out, knit_expand('child_rcbd_fail.Rmd')) } }
r paste(knit(text = out), collapse = '\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.