% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{gss_2024}
\alias{gss_2024}
\title{GSS 2024: General Social Survey}
\format{
A data frame with 3,309 rows and 27 variables:
\describe{
\item{vpsu}{Variance primary sampling unit. Use as the cluster ID for
variance estimation.}
\item{vstrat}{Variance stratum. Use as the stratification variable.}
\item{wtssps}{Person post-stratification weight. Standard analysis
weight.}
\item{wtssnrps}{Person post-stratification weight adjusted for
differential non-response. Preferred when non-response bias is a
concern.}
\item{id}{Respondent ID. Unique case identifier.}
\item{year}{Survey year (all \code{2024} in this extract).}
\item{ballot}{Ballot form (\code{A}, \code{B}, \code{C}, or \code{D}). The GSS uses a
split-ballot design; not all questions appear on every ballot.
Inapplicable items are coded \code{-100}.}
\item{age}{Age in years (\code{89} = 89 or older).}
\item{sex}{Sex: \code{1} = male, \code{2} = female.}
\item{race}{Race: \code{1} = white, \code{2} = black, \code{3} = other.}
\item{hispanic}{Hispanic origin: \code{1} = not Hispanic; \code{2}–\code{50} = specific
Hispanic origin.}
\item{educ}{Highest year of school completed (0–20 years).}
\item{degree}{Highest degree: \code{0} = less than HS, \code{1} = high school,
\code{2} = associate, \code{3} = bachelor's, \code{4} = graduate.}
\item{income16}{Total family income (26 categories from < $1,000 to
$170,000+).}
\item{marital}{Marital status: \code{1} = married, \code{2} = widowed,
\code{3} = divorced, \code{4} = separated, \code{5} = never married.}
\item{wrkstat}{Labor force status: \code{1} = full time, \code{2} = part time,
\code{3} = temporarily not working, \code{4} = unemployed, \code{5} = retired,
\code{6} = in school, \code{7} = keeping house, \code{8} = other.}
\item{hrs1}{Hours worked last week (for employed respondents only).}
\item{adults}{Number of adults in household (\code{8} = 8 or more).}
\item{partyid}{Party identification: \code{0} = strong Democrat,
\code{3} = Independent, \code{6} = strong Republican, \code{7} = other party.}
\item{polviews}{Political views: \code{1} = extremely liberal,
\code{7} = extremely conservative.}
\item{happy}{General happiness: \code{1} = very happy, \code{2} = pretty happy,
\code{3} = not too happy.}
\item{health}{Self-rated health: \code{1} = excellent, \code{2} = good,
\code{3} = fair, \code{4} = poor.}
\item{trust}{Social trust: \code{1} = most people can be trusted,
\code{2} = can't be too careful, \code{3} = depends.}
\item{natfare}{Government spending on welfare: \code{1} = too little,
\code{2} = about right, \code{3} = too much.}
\item{abany}{Abortion for any reason: \code{1} = yes, \code{2} = no.}
\item{attend}{Religious service attendance: \code{0} = never,
\code{8} = several times a week.}
\item{relig}{Religious preference: \code{1} = Protestant, \code{2} = Catholic,
\code{3} = Jewish, \code{4} = none, and others.}
}
}
\source{
NORC at the University of Chicago. General Social Survey 2024.
\url{https://gss.norc.org} (free account required to download raw data;
the processed \code{.rda} is included in the package).
Prepared by \verb{data-raw/prepare-gss-2024.R}.
}
\usage{
gss_2024
}
\description{
A 27-variable extract from the 2024 General Social Survey (GSS), one of
the longest-running sociological surveys in the United States (fielded
annually or biennially since 1972). All 3,309 respondents from the 2024
cross-section are included.
}
\details{
\strong{Survey design:} Stratified multi-stage cluster — use Taylor series
linearization:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{svy <- as_survey(gss_2024,
  ids     = vpsu,
  strata  = vstrat,
  weights = wtssps,      # or wtssnrps for non-response-adjusted weight
  nest    = TRUE
)
}\if{html}{\out{</div>}}

\strong{Missing value codes:} The GSS uses a consistent system of negative
integer codes for missing data across all variables:\tabular{ll}{
   Code \tab Meaning \cr
   \code{-100} \tab Inapplicable (question not asked of this respondent) \cr
   \code{-99} \tab No answer \cr
   \code{-98} \tab Don't know \cr
   \code{-97} \tab Skipped on web \cr
   \code{-90} \tab Refused \cr
}


These codes are stored as value labels on every column (check
\code{attr(gss_2024$happy, "labels")}). Recode them to \code{NA} before analysis.

\strong{Split-ballot design:} The \code{ballot} variable indicates which question
module a respondent received. Variables asked only on some ballots will
have \code{-100} (Inapplicable) for respondents on other ballots.

\strong{Metadata:}
All columns carry variable labels and value labels as R attributes from the
original SPSS file, automatically extracted into surveycore's metadata
system when you call \code{as_survey()}.
\itemize{
\item \strong{Variable labels} (\code{"label"} attribute): A human-readable description of
each column. Example: \code{attr(gss_2024$happy, "label")} returns
\code{"GENERAL HAPPINESS"}.
\item \strong{Value labels} (\code{"labels"} attribute): A named numeric vector mapping
each code to its meaning, including all missing-value codes. Example:
\code{attr(gss_2024$happy, "labels")} returns entries for \verb{Very happy},
\verb{Pretty happy}, \verb{Not too happy}, and the negative missing codes.
}
}
\examples{
# Variables in the dataset
names(gss_2024)

# Create survey design
svy <- as_survey(
  gss_2024,
  ids = vpsu,
  strata = vstrat,
  weights = wtssps,
  nest = TRUE
)

# Inspect variable label
attr(gss_2024$happy, "label")

# Inspect value labels (includes GSS missing-value codes)
attr(gss_2024$happy, "labels")

# Split-ballot: how many respondents per ballot form?
table(gss_2024$ballot)
}
\keyword{datasets}
