ppd_plot {spsurvey} | R Documentation |
Plot power curves for panel designs
Description
Plot power curves and relative power curves for trend detection for set of panel designs, time periods, indicators, significance levels and trend. Trend may be based on percent change per period in mean or percent change in proportion of cumulative distribution function above or below a fixed cut point. Types of plots are combinations of standard/relative, mean/percent, period/change and design/indicator. Input must be be of class powerpaneldesign and is normally the output of function power_dsgn.
Usage
ppd_plot(
object,
plot_type = "standard",
trend_type = "mean",
xaxis_type = "period",
comp_type = "design",
dsgns = NULL,
indicator = NULL,
trend = NULL,
period = NULL,
alpha = NULL,
...
)
Arguments
object |
List object of class |
plot_type |
Default is |
trend_type |
Character value for trend in mean ( |
xaxis_type |
Character value equal to |
comp_type |
Character value equal to |
dsgns |
Vector of names of panel designs that are to be plotted. Names
must be all, or a subset of, names of designs in |
indicator |
Vector of indicator names contained in |
trend |
|
period |
|
alpha |
A single value or vector of significance levels (as proportion,
e.g. |
... |
Additional arguments (S3 consistency) |
Details
By default the plot function produces a standard power curve at end
of each time period on the x-axis with y-axis as power. When more than one
panel design is in dsgnpower
, the first panel design is used. When more than
one indicator is in dsgnpower
, the first indicator is used. When more than
one trend value is in dsgnpower
, the maximum trend value is used. When more
than one significance level, alpha
, is in dsgnpower
, the minimum
significance level is used.
Control of the type of plot produced is governed by plot_type
, trend_type
,
xaxis_type
and comp_type
. The number of plots produced is governed by the
number of panel designs (dsgn
) specified, the number of indicators
(indicator
) specified, the number of time periods (period
) specifies, the
number of trend values (trend) specified and the number of significance
levels (alpha
) specified.
When the comparison type ("comp_type"
) is equal to "design"
, all power
curves specified by dsgn are plotted on the same plot. When comp_type
is
equal to "indicator"
, all power curves specified by "indicator"
are plotted
on the same plot. Typically, no more than 4-5 power curves should be
plotted on same plot.
Value
One or more power curve plots are created and plotted. User must specify output graphical device if more than one plot is created. See Devices for graphical output options.
Author(s)
Tony Olsen Olsen.Tony@epa.gov
Examples
## Not run:
# Construct a rotating panel design with sample size of 60
R60N <- revisit_dsgn(20, panels = list(R60N = list(
n = 60, pnl_dsgn = c(1, NA),
pnl_n = NA, start_option = "None"
)), begin = 1)
# Construct a fixed panel design with sample size of 60
F60 <- revisit_dsgn(20, panels = list(F60 = list(
n = 60, pnl_dsgn = c(1, 0),
pnl_n = NA, start_option = "None"
)), begin = 1)
# Power for rotating panel with sample size 60
Power_tst <- power_dsgn("Variable_Name",
ind_values = 43, unit_var = 280,
period_var = 4, unitperiod_var = 40, index_var = 90,
unit_rho = 1, period_rho = 0, paneldsgn = list(
R60N = R60N, F60 = F60
), nrepeats = NULL,
trend_type = "mean", trend = c(1.0, 2.0), alpha = 0.05
)
ppd_plot(Power_tst)
ppd_plot(Power_tst, dsgns = c("F60", "R60N"))
ppd_plot(Power_tst, dsgns = c("F60", "R60N"), trend = 1.0)
ppd_plot(Power_tst,
plot_type = "relative", comp_type = "design",
trend_type = "mean", trend = c(1, 2), dsgns = c("R60N", "F60"),
indicator = "Variable_Name"
)
## End(Not run)