metan (version 1.2.1)

resp_surf: Response surface model

Description

Compute a surface model and find the best combination of factor1 and factor2 to obtain the stationary point.

Usage

resp_surf(
  .data,
  factor1,
  factor2,
  rep = NULL,
  resp,
  prob = 0.05,
  verbose = TRUE
)

Arguments

.data

The dataset containing the columns related to Environments, factor1, factor2, replication/block and response variable(s).

factor1

The first factor, for example, dose of Nitrogen.

factor2

The second factor, for example, dose of potassium.

rep

The name of the column that contains the levels of the replications/blocks, if a designed experiment was conducted. Defaults to NULL.

resp

The response variable(s).

prob

The probability error.

verbose

If verbose = TRUE then some results are shown in the console.

Examples

Run this code
# NOT RUN {
library(metan)
# A small toy example

df = data.frame(
 expand.grid(x = seq(0, 4, by = 1),
             y = seq(0, 4, by = 1)),
 z = c(10, 11, 12, 11, 10,
       14, 15, 16, 15, 14,
       16, 17, 18, 17, 16,
       14, 15, 16, 15, 14,
       10, 11, 12, 11, 10)
)
mod = resp_surf(df, x, y, resp = z)
plot(mod)

# }

Run the code above in your browser using DataCamp Workspace