
This test requires that the user knows upper and lower bounds before gathering the data such that the properties of the data generating process imply that all observations will be within these bounds. The data input consists of a sequence of observations, each being an independent realization of the random variable. No further distributional assumptions are made.
npVarianceSingle(x, v, lower = 0, upper = 1,
alternative = "two.sided", alpha = 0.05, iterations = 5000,
epsilon = 1 * 10^(-6), ignoreNA = FALSE, max.iterations = 100000)
a (non-empty) numeric vector of data values.
the value of the variance to be tested as
the theoretical lower and upper bounds on the data outcomes known ex-ante before gathering the data.
a character string describing the alternative hypothesis, can take values "greater", "less" or "two.sided"
the type I error.
the number of iterations used, should not be changed if the exact solution should be derived.
the tolerance in terms of probability of the Monte Carlo simulations.
if TRUE
, NA values will be omitted. Default:
FALSE
the maximum number of iterations that should be
carried out. This number could be increased to achieve greater accuracy in
cases where the difference between the threshold probability and theta is
small. Default: 10000
A list with class "nphtest" containing the following components:
a character string indicating the name and type of the test that was performed.
a character string giving the name(s) of the data.
a character string describing the alternative hypothesis.
the estimated mean or difference in means depending on whether it was a one-sample test or a two-sample test.
numerical estimate of the rejection
probability of the randomized test, derived by taking an average of
iterations
realizations of the rejection probability.
the lower and upper bounds of the variables.
the specified hypothesized value of the correlation between the variables.
the type I error.
the parameter that minimizes the type II error.
theta
*alpha
, this is the level used when calculating the
average rejection probability during the iterations.
logical indicator for whether or not the null hypothesis can be rejected.
the number of iterations that were performed.
This is a test of the null hypothesis
This test randomly matches the data into pairs, then computes for each pair the square of the difference and continues with the resulting sequence with half as many observations as npMeanSingle. See the cited paper for more information.
Karl Schlag (2008). Exact tests for correlation and for the slope in simple linear regressions without making assumptions. Available at https://ideas.repec.org/p/upf/upfgen/1097.html.
# NOT RUN {
## see if the minority share holder shores have a variance greater
## than 0.05
data(mshscores)
scores <- unlist(mshscores)
npVarianceSingle(scores, lower = 0, upper = 1, v = 0.05, ignoreNA = TRUE)
# }
Run the code above in your browser using DataLab