zcurve | R Documentation |
zcurve
is used to fit z-curve models. The function
takes input of z-statistics or two-sided p-values and returns object of
class "zcurve"
that can be further interrogated by summary and plot
function. It default to EM model, but different version of z-curves can
be specified using the method
and control
arguments. See
'Examples' and 'Details' for more information.
zcurve(
z,
z.lb,
z.ub,
p,
p.lb,
p.ub,
data,
method = "EM",
bootstrap = 1000,
parallel = FALSE,
control = NULL
)
z |
a vector of z-scores. |
z.lb |
a vector with start of censoring intervals of censored z-scores. |
z.ub |
a vector with end of censoring intervals of censored z-scores. |
p |
a vector of two-sided p-values, internally transformed to z-scores. |
p.lb |
a vector with start of censoring intervals of censored two-sided p-values. |
p.ub |
a vector with end of censoring intervals of censored two-sided p-values. |
data |
an object created with |
method |
the method to be used for fitting. Possible options are
Expectation Maximization |
bootstrap |
the number of bootstraps for estimating CI. To skip
bootstrap specify |
parallel |
whether the bootstrap should be performed in parallel.
Defaults to |
control |
additional options for the fitting algorithm more details in control EM or control density. |
The function returns the EM method by default and changing
method = "density"
gives the KD2 version of z-curve as outlined in
\insertCitezcurve2;textualzcurve. For the original z-curve
\insertCitezcurve1zcurve, referred to as KD1, specify
'control = "density", control = list(model = "KD1")'
.
The fitted z-curve object
summary.zcurve()
, plot.zcurve()
, control_EM, control_density
# load data from OSC 2015 reproducibility project
OSC.z
# fit an EM z-curve (with disabled bootstrap due to examples times limits)
m.EM <- zcurve(OSC.z, method = "EM", bootstrap = FALSE)
# a version with 1000 boostraped samples would looked like:
m.EM <- zcurve(OSC.z, method = "EM", bootstrap = 1000)
# or KD2 z-curve (use larger bootstrap for real inference)
m.D <- zcurve(OSC.z, method = "density", bootstrap = FALSE)
# inspect the results
summary(m.EM)
summary(m.D)
# see '?summary.zcurve' for more output options
# plot the results
plot(m.EM)
plot(m.D)
# see '?plot.zcurve' for more plotting options
# to specify more options, set the control arguments
# ei. increase the maximum number of iterations and change alpha level
ctr1 <- list(
"max_iter" = 9999,
"alpha" = .10
)
## Not run: m1.EM <- zcurve(OSC.z, method = "EM", bootstrap = FALSE, control = ctr1)
# see '?control_EM' and '?control_density' for more information about different
# z-curves specifications
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.