This function splits the data.table output by PrepareStabData into a list using the Outcome and Practice fields, then applies ERAg::StabCalc to each element of the list. The results are concatenated and returned in a list.

StabCalc2(
  Data,
  Do.Weight = TRUE,
  Weight.by.Study = TRUE,
  Rm.Out = TRUE,
  Transform = TRUE,
  DoRandom = TRUE,
  Control = list(optimizer = "optim", optmethod = "Nelder-Mead", maxit = 10000),
  Responses = c("lnRR", "lnVR", "lnCVR"),
  Use.acv = FALSE,
  Inc.Prod = FALSE,
  Cores = 1
)

Arguments

Data

A data.table generated by the ERAg::PrepareStabData function.

Do.Weight

Logical. If TRUE, coefficient estimates are weighted according to the weightings in the Data object (default = TRUE).

Weight.by.Study

Logical. This parameter is deprecated (default = TRUE).

Rm.Out

Logical. If TRUE, extreme outliers are removed within each Practice x Outcome combination (default = TRUE).

Transform

Logical. If TRUE, back-transformed coefficient estimates and confidence intervals are appended to outputs (default = TRUE).

DoRandom

Logical. If TRUE, random effects models are included (default = TRUE).

Control

List of control values for the rma.mv estimation algorithm. Defaults to list(optimizer="optim", optmethod="Nelder-Mead", maxit=10000).

Responses

Character vector of response variables (default = c("lnRR","lnVR","lnCVR")).

Use.acv

Logical. If TRUE, uses the scale-adjusted coefficient of variation (acv) instead of the coefficient of variation (cv) (default = FALSE).

Inc.Prod

Logical. If TRUE, analysis is conducted at the Crop x Outcome x Practice level (default = FALSE).

Cores

Integer. Number of cores to use for parallel processing. If Cores = 1, runs sequentially (default = 1).

Value

A list containing:

  1. [[StabStats]]: Results from ERAg::StabCalc for each Practice x Outcome (and EU if Inc.Prod = TRUE).

  2. [[StabStats.Test]]: Equivalent of the [[Tests]] output from ERAg::StabCalc.

  3. [[StabStats.Tab]]: Equivalent of the [[Coefs]] output from ERAg::StabCalc.

  4. [[StabStats.Test2]]: Equivalent of the [[Tests2]] output from ERAg::StabCalc.

  5. [[StabList]]: A list of the input Data, split by Practice and Outcome (and EU if Inc.Prod = TRUE).