Description Usage Arguments Details Value
Find site-specific critical values of a single latent factor Z in a fitted SEM corresponding to a given critical PSM risk, and differences between the critical values and current values of Z, for a specified confidence level.
1 | sem_z_crit(fit, data, newsites = NULL, psm_crit, level = "site", alpha)
|
fit |
Object of class |
data |
The data list passed to |
newsites |
Optional numeric vector of length |
psm_crit |
PSM threshold in the interval (0,1). |
level |
Level of grouping at which to predict. Options are |
alpha |
Confidence level. |
sem_z_crit
assumes fit
represents a single-factor model in which
I_b0_Z == 1
(that is, the site-specific fitted intercept includes an effect of Z,
and that the estimate of that effect is generally positive. Currently
sem_z_crit
assumes sample-average precipitation conditions; this will be relaxed in
the future. Critical values of Z are found by first solving for the site-specific
zero of P(PSM | Z, data) = 0 for each posterior sample, and then finding the
(1 - alpha/(1 - F(0)) quantile of those sampled zeros for each site that correspond to
positive slopes, where F(0) is the empirical CDF of the slope w.r.t. Z
evaluated at zero. This method is conservative; it guarantees that at least proportion
alpha of the posterior sample of curves (i.e., those with positive slopes) will be
less than psm_crit
for all Z < Z_crit, but it requires that
F(0) < 1 - alpha. Otherwise an error will be returned. Differences between z_crit
and the alpha-th posterior quantile of estimated site-specific Z are also
calculated.
A list with elements
zeros
An iter x S matrix,
where S is the number of sites in fit
, containing posterior samples of
the site-specific zeros of P(PSM | Z) - psm_crit as a function of Z.
z_crit
Numeric vector of length S containing site-specific critical Z-values.
delta_z
Numeric vector of length S containing differences between
z_crit
and the alpha-th posterior quantile of site-specific Z.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.