library(tidyverse)
library(gtsummary)
# Load updated data
df <- read_csv("AI Impatience Video Survey Data.csv")
# Clean and prepare the data
df_clean <- df %>%
filter(!is.na(Age), !is.na(Gender), !is.na(Q21)) %>%
mutate(
Age = as.numeric(Age),
Gender = as.factor(Gender),
Q20 = as.numeric(Q21) # assuming Q20 is a Likert-style response
)
# Create gtsummary table
df_clean %>%
tbl_summary(
by = Gender,
include = c(Age, Q21),
statistic = list(all_continuous() ~ "{mean} ({sd})"),
digits = all_continuous() ~ 1,
missing = "no"
) %>%
add_p() %>%
modify_caption("**Table: Influence of Age and Gender on Responses to Q20**") %>%
bold_labels()
Characteristic | Female N = 461 |
Male N = 471 |
What is your gender? N = 11 |
p-value2 |
---|---|---|---|---|
Age | 21.6 (5.5) | 21.0 (2.0) | NA (NA) | >0.9 |
Q21 | 0.2 | |||
1 | 12 (26%) | 10 (21%) | 0 (0%) | |
2 | 5 (11%) | 9 (19%) | 0 (0%) | |
3 | 2 (4.3%) | 7 (15%) | 0 (0%) | |
4 | 7 (15%) | 5 (11%) | 0 (0%) | |
5 | 9 (20%) | 6 (13%) | 0 (0%) | |
6 | 3 (6.5%) | 3 (6.4%) | 0 (0%) | |
7 | 8 (17%) | 7 (15%) | 0 (0%) | |
You're enjoying a quiet night in at home, about to watch a movie but you've just gotten a craving for your favorite restaurant. To what extent do you find it desirable to use an app-based delivery service (i.e. Uber Eats, Door Dash) and pay for the food delivery fee plus some tips (i.e., around 5-10 dollars in total) to bring your food to you in the comfort of your own home? | 0 (0%) | 0 (0%) | 1 (100%) | |
1 Mean (SD); n (%) | ||||
2 Kruskal-Wallis rank sum test; Fisher’s exact test |