A simulated dataset of 1200 respondents from a fictional social-health survey, designed to illustrate the main features of the spicy package: variable labels, ordered factors, survey weights, association measures, and APA-style reporting.
sochealthA tibble with 1200 rows and 24 variables:
Factor. Sex of the respondent.
Numeric. Age in years (25--75).
Ordered factor. Age group (25--34, 35--49, 50--64, 65--75).
Ordered factor. Highest education level (Lower secondary, Upper secondary, Tertiary).
Ordered factor. Subjective social class (Lower, Working, Lower middle, Middle, Upper middle).
Factor. Region of residence (6 regions).
Factor. Employment status (Employed, Student, Unemployed, Inactive).
Ordered factor. Household income group (Low, Lower middle, Upper middle, High). Contains missing values.
Numeric. Monthly household income in CHF.
Factor. Current smoker (No, Yes). Contains missing values.
Factor. Regular physical activity (No, Yes).
Factor. Dentist visit in the last 12 months (No, Yes).
Ordered factor. Self-rated health (Poor, Fair, Good, Very good). Contains missing values.
Numeric. WHO-5 wellbeing index (0--100).
Numeric. Body mass index. Contains missing values.
Ordered factor. BMI category (Normal weight, Overweight, Obesity). Contains missing values.
Ordered factor. Trust in institutions (Very low, Low, High, Very high).
Numeric. Political position on a 0 (left) to 10 (right) scale. Contains missing values.
Integer. Satisfaction with own health (1--5 Likert scale). Contains missing values.
Integer. Satisfaction with work or main activity (1--5 Likert scale). Contains missing values.
Integer. Satisfaction with personal relationships (1--5 Likert scale). Contains missing values.
Integer. Satisfaction with standard of living (1--5 Likert scale). Contains missing values.
POSIXct. Date and time of survey response (September--November 2024).
Numeric. Survey design weight.
All variables carry labels (accessible via labelled::var_label()
and displayed by varlist()). Several ordered factors are included
so that cross_tab() can demonstrate automatic ordinal measure
selection.
data(sochealth)
varlist(sochealth)
freq(sochealth, education)
cross_tab(sochealth, education, self_rated_health)
Run the code above in your browser using DataLab