specify {infer} | R Documentation |
Specify response and explanatory variables
Description
specify()
is used to specify which columns in the supplied data frame are
the relevant response (and, if applicable, explanatory) variables. Note that
character variables are converted to factor
s.
Learn more in vignette("infer")
.
Usage
specify(x, formula, response = NULL, explanatory = NULL, success = NULL)
Arguments
x |
A data frame that can be coerced into a tibble. |
formula |
A formula with the response variable on the left and the
explanatory on the right. Alternatively, a |
response |
The variable name in |
explanatory |
The variable name in |
success |
The level of |
Value
A tibble containing the response (and explanatory, if specified) variable data.
See Also
Other core functions:
calculate()
,
generate()
,
hypothesize()
Examples
# specifying for a point estimate on one variable
gss %>%
specify(response = age)
# specify a relationship between variables as a formula...
gss %>%
specify(age ~ partyid)
# ...or with named arguments!
gss %>%
specify(response = age, explanatory = partyid)
# more in-depth explanation of how to use the infer package
## Not run:
vignette("infer")
## End(Not run)