Download the datasets for this class:
The codebook for the survey to find the question wording for a variable
For those who prefer to work with RCloud, a project with the same materials can be accessed using the following link:
Load the necessary packages:
library(descr)
library(dplyr)
library(ggplot2)
Load General Social Survey 98 (gss98.RData
):
load("Datasets/gss98.RData")
Have R create a CROSSTAB with CAPPUN
as the dependent variable and SEX
as the independent variable:
CrossTable(gss98$CAPPUN, gss98$SEX, prop.r = T, prop.c = T, prop.t = T, prop.chisq = F, format = "SPSS")
## Cell Contents
## |-------------------------|
## | Count |
## | Row Percent |
## | Column Percent |
## | Total Percent |
## |-------------------------|
##
## ======================================
## gss98$SEX
## gss98$CAPPUN female male Total
## --------------------------------------
## Favor 348 309 657
## 53.0% 47.0% 71.6%
## 67.1% 77.4%
## 37.9% 33.7%
## --------------------------------------
## Oppose 171 90 261
## 65.5% 34.5% 28.4%
## 32.9% 22.6%
## 18.6% 9.8%
## --------------------------------------
## Total 519 399 918
## 56.5% 43.5%
## ======================================
Answer the following questions based on this table:
a) Calculate the row, column, and total percentages for the first row, checking your answers against the computer output.
b) Give brief explanations of the nine percentages in the first row (e.g., 53.0 percent of the ________ are _______).
c) What percentage of the men oppose capital punishment for murder?
f) What percentage of the women oppose capital punishment for murder?
g) What percentage of those who oppose capital punishment for murder are men?
h) What percentage of those who oppose capital punishment for murder are women?
i) What percentage of the entire group are men?
j) What percentage of the entire group oppose capital punishment for murder?
k) What percentage of the entire group are men who oppose capital punishment for murder?
Knit your report & publish it on RPubs