# NOT RUN {
# two-sample proportion test for difference in proportions of
# college completion by respondent sex
prop_test(gss,
college ~ sex,
order = c("female", "male"))
# one-sample proportion test for hypothesized null
# proportion of college completion of .2
prop_test(gss,
college ~ NULL,
p = .2)
# report as a z-statistic rather than chi-square
# and specify the success level of the response
prop_test(gss,
college ~ NULL,
success = "degree",
p = .2,
z = TRUE)
# }
Run the code above in your browser using DataLab