Maturing lifecycle

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)

Arguments

x

A data frame that can be coerced into a tibble.

null

The null hypothesis. Options include "independence" and "point".

p

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.

mu

The true mean (any numerical value). To be used with point null hypotheses when the specified response variable is continuous.

med

The true median (any numerical value). To be used with point null hypotheses when the specified response variable is continuous.

sigma

The true standard deviation (any numerical value). To be used with point null hypotheses.

Value

A tibble containing the response (and explanatory, if specified) variable data with parameter information stored as well.

Examples

# hypothesize independence of two variables gss %>% specify(college ~ partyid, success = "degree") %>% hypothesize(null = "independence")
#> Warning: Removed 33 rows containing missing values.
#> Response: college (factor) #> Explanatory: partyid (factor) #> Null Hypothesis: independence #> # A tibble: 2,967 x 2 #> college partyid #> <fct> <fct> #> 1 no degree dem #> 2 no degree dem #> 3 degree ind #> 4 degree rep #> 5 no degree dem #> 6 no degree dem #> 7 no degree dem #> 8 no degree rep #> 9 no degree ind #> 10 no degree rep #> # … with 2,957 more rows
# hypothesize a mean number of hours worked per week of 40 gss %>% specify(response = hours) %>% hypothesize(null = "point", mu = 40)
#> Warning: Removed 1244 rows containing missing values.
#> Response: hours (numeric) #> Null Hypothesis: point #> # A tibble: 1,756 x 1 #> hours #> <dbl> #> 1 50 #> 2 60 #> 3 84 #> 4 40 #> 5 50 #> 6 60 #> 7 40 #> 8 20 #> 9 40 #> 10 40 #> # … with 1,746 more rows
# More in-depth explanation of how to use the infer package vignette("infer")
#> Warning: vignette ‘infer’ not found