
Last chance! 50% off unlimited learning
Sale ends in
Declare a null hypothesis about variables selected in specify()
.
Learn more in vignette("infer")
.
hypothesize(x, null, p = NULL, mu = NULL, med = NULL, sigma = NULL)hypothesise(x, null, p = NULL, mu = NULL, med = NULL, sigma = NULL)
A tibble containing the response (and explanatory, if specified) variable data with parameter information stored as well.
A data frame that can be coerced into a tibble.
The null hypothesis. Options include "independence"
,
"point"
, and "paired independence"
.
independence
: Should be used with both a response
and explanatory
variable. Indicates that the values of the specified response
variable
are independent of the associated values in explanatory
.
point
: Should be used with only a response
variable. Indicates
that a point estimate based on the values in response
is associated
with a parameter. Sometimes requires supplying one of p
, mu
, med
, or
sigma
.
paired independence
: Should be used with only a response
variable
giving the pre-computed difference between paired observations. Indicates
that the order of subtraction between paired values does not affect the
resulting distribution.
The true proportion of successes (a number between 0 and 1). To be used with point null hypotheses when the specified response variable is categorical.
The true mean (any numerical value). To be used with point null hypotheses when the specified response variable is continuous.
The true median (any numerical value). To be used with point null hypotheses when the specified response variable is continuous.
The true standard deviation (any numerical value). To be used with point null hypotheses.
Other core functions:
calculate()
,
generate()
,
specify()
# hypothesize independence of two variables
gss %>%
specify(college ~ partyid, success = "degree") %>%
hypothesize(null = "independence")
# hypothesize a mean number of hours worked per week of 40
gss %>%
specify(response = hours) %>%
hypothesize(null = "point", mu = 40)
# more in-depth explanation of how to use the infer package
if (FALSE) {
vignette("infer")
}
Run the code above in your browser using DataLab