Skip to content

Commit

Permalink
update icREML spats example
Browse files Browse the repository at this point in the history
  • Loading branch information
AparicioJohan committed May 3, 2024
1 parent b1cd250 commit 54ce7eb
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 57 deletions.
1 change: 1 addition & 0 deletions R/SpATS.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ coef_SpATS <- function(model) {
#' @examples
#' \donttest{
#' library(SpATS)
#' library(agriutilities)
#' data(wheatdata)
#' wheatdata$R <- as.factor(wheatdata$row)
#' wheatdata$C <- as.factor(wheatdata$col)
Expand Down
40 changes: 40 additions & 0 deletions R/icREML.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,46 @@ ic_reml_asr <- function(fm, scale = 1) {
#' }
#' @export
#'
#' @examples
#' \donttest{
#' library(SpATS)
#' library(agriutilities)
#' data(wheatdata)
#' wheatdata$R <- as.factor(wheatdata$row)
#' wheatdata$C <- as.factor(wheatdata$col)
#'
#' m1 <- SpATS(
#' response = "yield",
#' spatial = ~ PSANOVA(col, row, nseg = c(10, 20), nest.div = 2),
#' genotype = "geno",
#' genotype.as.random = TRUE,
#' fixed = ~ colcode + rowcode,
#' random = ~ R + C,
#' data = wheatdata,
#' control = list(tolerance = 1e-03, monitoring = 0)
#' )
#'
#' m2 <- SpATS(
#' response = "yield",
#' spatial = ~ PSANOVA(col, row, nseg = c(10, 20), nest.div = 2),
#' genotype = "geno",
#' genotype.as.random = TRUE,
#' fixed = ~colcode,
#' random = ~ R + C,
#' data = wheatdata,
#' control = list(tolerance = 1e-03, monitoring = 0)
#' )
#'
#' rbind.data.frame(
#' ic_reml_spt(m1, label = "colcode_rowcode"),
#' ic_reml_spt(m2, label = "colcode_no_rowcode")
#' )
#'
#' rbind.data.frame(
#' h_cullis_spt(m1),
#' h_cullis_spt(m2)
#' )
#' }
#' @author Johan Aparicio
#' @references
#' Verbyla, A. P. (2019). A note on model selection using information
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/how-to-start.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 54ce7eb

Please sign in to comment.