getPlotSummary {iNZightPlots} | R Documentation |
iNZight Plot Summary and Inference
Description
Generate summary or inference information for an iNZight plot
Usage
getPlotSummary(
x,
y = NULL,
g1 = NULL,
g1.level = NULL,
g2 = NULL,
g2.level = NULL,
varnames = list(),
colby = NULL,
sizeby = NULL,
data = NULL,
design = NULL,
freq = NULL,
missing.info = TRUE,
inzpars = inzpar(),
summary.type = "summary",
table.direction = c("horizontal", "vertical"),
hypothesis.value = 0,
hypothesis.alt = c("two.sided", "less", "greater"),
hypothesis.var.equal = FALSE,
hypothesis.use.exact = FALSE,
hypothesis.test = c("default", "t.test", "anova", "chi2", "proportion"),
hypothesis.simulated.p.value = FALSE,
hypothesis = list(value = hypothesis.value, alternative = match.arg(hypothesis.alt),
var.equal = hypothesis.var.equal, use.exact = hypothesis.use.exact, test =
match.arg(hypothesis.test), simulated.p.value = hypothesis.simulated.p.value),
survey.options = list(),
width = 100,
epi.out = FALSE,
privacy_controls = NULL,
html = FALSE,
...,
env = parent.frame()
)
Arguments
x |
a vector (numeric or factor), or the name of a column in the supplied
|
y |
a vector (numeric or factor), or the name of a column in the supplied
|
g1 |
a vector (numeric or factor), or the name of a column in the supplied
|
g1.level |
the name (or numeric position) of the level of |
g2 |
a vector (numeric or factor), or the name of a column in the supplied
|
g2.level |
same as |
varnames |
a list of variable names, with the list named using the appropriate arguments
(i.e., |
colby |
the name of a variable (numeric or factor) to colour points by. In the case of a numeric variable, a continuous colour scale is used, otherwise each level of the factor is assigned a colour |
sizeby |
the name of a (numeric) variable, which controls the size of points |
data |
the name of a data set |
design |
the name of a survey object, obtained from the |
freq |
the name of a frequency variable if the data are frequencies |
missing.info |
logical, if |
inzpars |
allows specification of iNZight plotting parameters over multiple plots |
summary.type |
one of |
table.direction |
one of 'horizontal' (default) or 'vertical' (useful for many categories) |
hypothesis.value |
H0 value for hypothesis test |
hypothesis.alt |
alternative hypothesis (!=, <, >) |
hypothesis.var.equal |
use equal variance assumption for t-test? |
hypothesis.use.exact |
logical, if |
hypothesis.test |
in some cases (currently just two-samples) can perform multiple tests (t-test or ANOVA) |
hypothesis.simulated.p.value |
also calculate (where available) the simulated p-value |
hypothesis |
either NULL for no test, or missing (in which case above arguments are used) |
survey.options |
additional options passed to survey methods |
width |
width for the output, default is 100 characters |
epi.out |
logical, if |
privacy_controls |
optional, pass in confidentialisation and privacy controls (e.g., random rounding, suppression) for microdata |
html |
logical, it |
... |
additional arguments, see |
env |
compatibility argument |
Details
Works much the same as iNZightPlot
Value
an inzight.plotsummary
object with a print method
Author(s)
Tom Elliott
Examples
getPlotSummary(Species, data = iris)
getPlotSummary(Species, data = iris,
summary.type = "inference", inference.type = "conf")
# perform hypothesis testing
getPlotSummary(Sepal.Length, data = iris,
summary.type = "inference", inference.type = "conf",
hypothesis.value = 5)
# if you prefer a formula interface
inzsummary(Sepal.Length ~ Species, data = iris)
inzinference(Sepal.Length ~ Species, data = iris)
## confidentialisation and privacy controls
# random rounding and suppression:
HairEyeColor_df <- as.data.frame(HairEyeColor)
inzsummary(Hair ~ Eye, data = HairEyeColor_df, freq = Freq)
inzsummary(Hair ~ Eye, data = HairEyeColor_df, freq = Freq,
privacy_controls = list(
rounding = "RR3",
suppression = 10
)
)