mod_alcc {soiltestcorr} | R Documentation |
Modified Arcsine-Log Calibration Curve
Description
This function runs the modified arcsine-log calibration curve to estimate critical soil test values (CSTV) following Correndo et al. (2017)
Usage
mod_alcc(
data = NULL,
ry,
stv,
target,
confidence = 0.95,
tidy = TRUE,
plot = FALSE
)
logLik_alcc(object, ...)
boot_mod_alcc(data, ry, stv, n = 500, target = 90, confidence = 0.95, ...)
Arguments
data |
Optional argument to call and object of type data.frame or data.table containing the stv and ry data, Default: NULL |
ry |
name of the vector containing relative yield values (%) of type |
stv |
name of the vector containing soil test values of type |
target |
|
confidence |
|
tidy |
logical operator (TRUE/FALSE) to decide the type of return. TRUE returns a tidy data frame or tibble (default), FALSE returns a list. |
plot |
logical operator (TRUE/FALSE) to decide the type of return. TRUE returns a ggplot, FALSE returns either a list (tidy == FALSE) or a data.frame (tidy == TRUE). |
object |
the "object" is the output data frame from approx with resid column |
... |
when running bootstrapped samples, the |
n |
sample size for the bootstrapping Default: 500 |
Details
See online-documentation for additional details.
Value
returns an object of type ggplot
if plot = TRUE.
returns an object of class data.frame
if tidy = TRUE,
returns an object of class list
if tidy = FALSE.
logLik_alcc: AIC on original scale function
boot_mod_alcc: bootstrapping function
Note
For extended reference, we recommend to visit doi:10.7910/DVN/NABA57 and https://github.com/adriancorrendo/modified-ALCC by Adrian Correndo.
References
Correndo et al. (2017). A modification of the arcsine–log calibration curve for analysing soil test value–relative yield relationships. Crop and Pasture Science, 68(3), 297-304. doi:10.1071/CP16444
See Also
eval_tidy
,defusing-advanced
TDist
,cor
,cor.test
,sd
, approx
bind
,filter
nest
ggplot
,aes
,geom_point
,scale_manual
,geom_rug
,geom_abline
,geom_path
,annotate
,labs
,theme
annotate
Examples
# Example 1 dataset
dat <- data.frame("ry" = c(65,80,85,88,90,94,93,96,97,95,98,100,99,99,100),
"stv" = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))
# Run
fit_example <- mod_alcc(data = dat, ry = ry, stv = stv, target=90, confidence = 0.95)
fit_example