Learn R Programming

fitplc (version 1.2-3)

getPx: Extract Px from fitted objects

Description

Extract esimates of Px from an object returned by fitplc, fitplcs, fitcond or fitconds. This function allows extraction of estimates of P88 or other values when the fit estimated P50 (or other).

With the Weibull model, it appears to be more robust to set x=50 when fitting the curve, and extracting other points with getPx.

See examples for use of this function. Note that the confidence interval is based on the bootstrap resampling performed by fitplc. If the bootstrap was not performed durinf the fit (i.e. boot=FALSE in fitplc or elsewhere), it only returns the fitted values, and not the confidence intervals.

Usage

getPx(object, x = 50, coverage = 0.95, rescale_Px = FALSE, ...)

# S3 method for default getPx(object, x = 50, coverage = 0.95, rescale_Px = FALSE, ...)

# S3 method for manyplcfit getPx(object, ...)

Arguments

object

Object returned by any of the fitting functions (e.g. fitplc)

x

The x in Px, that is, if P50 should be returned, x=50. Can be a vector, to return multiple points at once.

coverage

The desired coverage of the confidence interval (0.95 is the default).

rescale_Px

Logical (default FALSE). If TRUE, rescales calculation of Px for the sigmoidal model, by finding water potential relative to K at zero water potential (which for the sigmoidal model, is not equal to Kmax). If you fitted fitcond with rescale_Px = TRUE, make sure to set TRUE here as well to be consistent (it is not assumed from the fitted model, yet).

Further arguments passed to methods (none yet).

Methods (by class)

  • default: Calculate Px for a single fitted curve.

  • manyplcfit: Calculate Px for many fitted curves.

Details

Note that this function does not return a standard error, because the bootstrap confidence interval will be rarely symmetrical. If you like, you can calculate it as the mean of the half CI width (and note it as an 'approximate standard error'). A better approach is to only report the CI and not the SE.

Sometimes the upper CI cannot be calculated and will be reported as NA. This indicates that the upper confidence bound is outside the range of the data, and can therefore not be reliably reported. It is especially common when x is large, say for P88.

Examples

Run this code
# NOT RUN {
# A fit
somefit <- fitplc(stemvul, x=50, model="sigmoid")

# Extract P12, P88
# Note NA for upper CI for P88; this is quite common
# and should be interpreted as falling outside the range of the data.
getPx(somefit, x=c(12,88))

# Extract P88 from multiple fitted curves
fits <- fitplcs(stemvul, "Species", boot=FALSE)
getPx(fits, 88)

# }

Run the code above in your browser using DataLab