Randomized data under null model of independence
The infer package will allow you to model a particular null hypothesis and then randomize the data to calculate permuted statistics. In this exercise, after specifying your null hypothesis you will permute the home ownership variable 10 times. By doing so, you will ensure that there is no relationship between home ownership and gender, so any difference in home ownership proportion for female versus male will be due only to natural variability.
This exercise will demonstrate the first three steps from the infer package:
specifywill specify the response and explanatory variables.hypothesizewill declare the null hypothesis.generatewill generate resamples, permutations, or simulations.
The dplyr, ggplot2, NHANES, and infer packages have been loaded for you and the homes dataset you created in the last exercise is available in your workspace.
Diese Übung ist Teil des Kurses
Foundations of Inference in R
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Specify variables
homeown_perm <- homes %>%
___(___ ~ ___, success = "___")
# Print results to console
homeown_perm