# --- CARGA Y ESTRUCTURA ---
library(tidyr)
library(readxl)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
# Leer sin encabezados
df_raw <- read_excel("EncuestaMovilidad.xlsx", col_names = FALSE)
## New names:
## • `` -> `...1`
## • `` -> `...2`
## • `` -> `...3`
## • `` -> `...4`
## • `` -> `...5`
## • `` -> `...6`
## • `` -> `...7`
## • `` -> `...8`
## • `` -> `...9`
## • `` -> `...10`
## • `` -> `...11`
## • `` -> `...12`
## • `` -> `...13`
## • `` -> `...14`
## • `` -> `...15`
## • `` -> `...16`
## • `` -> `...17`
## • `` -> `...18`
## • `` -> `...19`
## • `` -> `...20`
## • `` -> `...21`
## • `` -> `...22`
## • `` -> `...23`
## • `` -> `...24`
## • `` -> `...25`
## • `` -> `...26`
## • `` -> `...27`
## • `` -> `...28`
## • `` -> `...29`
# Nombres técnicos desde fila 2
colnames <- df_raw[2, ] |> unlist() |> as.character()

# Diccionario de preguntas (fila 3)
questions <- df_raw[3, ] |> unlist() |> as.character()
names(questions) <- colnames  # Mapea Q1 → ¿texto?

# Datos reales desde fila 4
df <- df_raw[-c(1, 2, 3), ]
n
## function () 
## {
##     peek_mask()$get_current_group_size()
## }
## <bytecode: 0x5f8eea734240>
## <environment: namespace:dplyr>
str(df)                # Fechas y números deben estar convertidos correctamente
## tibble [101 × 29] (S3: tbl_df/tbl/data.frame)
##  $ ...1 : chr [1:101] "45818.735185185185" "45823.57929398148" "45823.57996527778" "45823.58033564815" ...
##  $ ...2 : chr [1:101] "45818.735300925924" "45823.57979166666" "45823.58027777778" "45823.72761574074" ...
##  $ ...3 : chr [1:101] "Survey Preview" "IP Address" "IP Address" "IP Address" ...
##  $ ...4 : chr [1:101] NA "189.175.0.159" "189.175.0.159" "131.178.102.176" ...
##  $ ...5 : chr [1:101] "100.0" "100.0" "100.0" "100.0" ...
##  $ ...6 : chr [1:101] "9.0" "43.0" "27.0" "12725.0" ...
##  $ ...7 : chr [1:101] "True" "True" "True" "True" ...
##  $ ...8 : chr [1:101] "45818.73530623843" "45823.57980677083" "45823.5802912963" "45823.72763070602" ...
##  $ ...9 : chr [1:101] "R_3loOQFR84p0F4Kx" "R_3OOyFXTbPzV4l3Z" "R_3zAvdXywOfrOudj" "R_1Ujip62zJkaNWSZ" ...
##  $ ...10: chr [1:101] NA NA NA NA ...
##  $ ...11: chr [1:101] NA NA NA NA ...
##  $ ...12: chr [1:101] NA NA NA NA ...
##  $ ...13: chr [1:101] NA NA NA NA ...
##  $ ...14: chr [1:101] "25.6449" "25.6818" "25.6818" "25.6818" ...
##  $ ...15: chr [1:101] "-100.311" "-100.2627" "-100.2627" "-100.2627" ...
##  $ ...16: chr [1:101] "preview" "anonymous" "anonymous" "anonymous" ...
##  $ ...17: chr [1:101] "ES-ES" "ES-ES" "ES-ES" "ES-ES" ...
##  $ ...18: chr [1:101] "Si, acepto" "Si, acepto" "Si, acepto" "Si, acepto" ...
##  $ ...19: chr [1:101] NA "Femenino" "Femenino" "Masculino" ...
##  $ ...20: chr [1:101] NA "18 años" "22 años" "20 años" ...
##  $ ...21: chr [1:101] NA NA NA NA ...
##  $ ...22: chr [1:101] NA NA NA NA ...
##  $ ...23: chr [1:101] NA NA NA NA ...
##  $ ...24: chr [1:101] NA "Algo" "Bastante" "Bastante" ...
##  $ ...25: chr [1:101] NA "Neutral" "De acuerdo" "Neutral" ...
##  $ ...26: chr [1:101] NA "En desacuerdo" "Neutral" "Neutral" ...
##  $ ...27: chr [1:101] NA "Neutral" "De acuerdo" "Neutral" ...
##  $ ...28: chr [1:101] NA "De acuerdo" "De acuerdo" "Neutral" ...
##  $ ...29: chr [1:101] "control" "luis" "luis_injusticia" "luis" ...
# 1. Usar fila 1 como nombres
colnames <- df_raw[1, ] |> unlist() |> as.character()

# 2. Extraer datos desde fila 2 en adelante
df <- df_raw[-1, ]
names(df) <- colnames

# 3. Limpiar estructura
df <- as.data.frame(df)
rownames(df) <- NULL
# Conversión de columnas clave
df <- df %>%
  filter(Finished == "True") %>%
  mutate(
    Progress = as.numeric(Progress),
    `Duration (in seconds)` = as.numeric(`Duration (in seconds)`),
    StartDate = as.POSIXct(as.numeric(StartDate), origin = "1899-12-30"),
    EndDate = as.POSIXct(as.numeric(EndDate), origin = "1899-12-30"),
    RecordedDate = as.POSIXct(as.numeric(RecordedDate), origin = "1899-12-30")
  )
colnames <- df_raw[1, ] |> unlist() |> as.character()
df <- df_raw[-1, ]
names(df) <- colnames
names(df)             # ¿Ves nombres como "StartDate", "Progress", "Q1", etc.?
##  [1] "StartDate"             "EndDate"               "Status"               
##  [4] "IPAddress"             "Progress"              "Duration (in seconds)"
##  [7] "Finished"              "RecordedDate"          "ResponseId"           
## [10] "RecipientLastName"     "RecipientFirstName"    "RecipientEmail"       
## [13] "ExternalReference"     "LocationLatitude"      "LocationLongitude"    
## [16] "DistributionChannel"   "UserLanguage"          "Q8"                   
## [19] "Q1"                    "Q4"                    "Q23"                  
## [22] "Q6"                    "Q24"                   "Q14"                  
## [25] "Q16"                   "Q17"                   "Q19"                  
## [28] "Q20"                   "tx"
str(df)               # ¿Ves Progress como numérico? ¿Fechas como POSIXct?
## tibble [103 × 29] (S3: tbl_df/tbl/data.frame)
##  $ StartDate            : chr [1:103] "Fecha de inicio" "45818.73303240741" "45818.735185185185" "45823.57929398148" ...
##  $ EndDate              : chr [1:103] "Fecha final" "45818.73327546296" "45818.735300925924" "45823.57979166666" ...
##  $ Status               : chr [1:103] "Tipo de respuesta" "Survey Preview" "Survey Preview" "IP Address" ...
##  $ IPAddress            : chr [1:103] "Dirección IP" NA NA "189.175.0.159" ...
##  $ Progress             : chr [1:103] "Progreso" "100.0" "100.0" "100.0" ...
##  $ Duration (in seconds): chr [1:103] "Duración (en segundos)" "20.0" "9.0" "43.0" ...
##  $ Finished             : chr [1:103] "Finalizado" "True" "True" "True" ...
##  $ RecordedDate         : chr [1:103] "Fecha registrada" "45818.73327994213" "45818.73530623843" "45823.57980677083" ...
##  $ ResponseId           : chr [1:103] "ID de respuesta" "R_31Xxwh2Evy2a5dO" "R_3loOQFR84p0F4Kx" "R_3OOyFXTbPzV4l3Z" ...
##  $ RecipientLastName    : chr [1:103] "Apellido del destinatario" NA NA NA ...
##  $ RecipientFirstName   : chr [1:103] "Nombre del destinatario" NA NA NA ...
##  $ RecipientEmail       : chr [1:103] "Correo electrónico del destinatario" NA NA NA ...
##  $ ExternalReference    : chr [1:103] "Datos de referencia externos" NA NA NA ...
##  $ LocationLatitude     : chr [1:103] "Latitud de ubicación" "25.6449" "25.6449" "25.6818" ...
##  $ LocationLongitude    : chr [1:103] "Longitud de ubicación" "-100.311" "-100.311" "-100.2627" ...
##  $ DistributionChannel  : chr [1:103] "Canal de la distribución" "preview" "preview" "anonymous" ...
##  $ UserLanguage         : chr [1:103] "Idioma del usuario" "ES-ES" "ES-ES" "ES-ES" ...
##  $ Q8                   : chr [1:103] "Estimadx participante: Te invitamos a responder esta encuesta como parte de un proyecto académico realizado por"| __truncated__ "Si, acepto" "Si, acepto" "Si, acepto" ...
##  $ Q1                   : chr [1:103] "Género" "Masculino" NA "Femenino" ...
##  $ Q4                   : chr [1:103] "¿Cuántos años tienes?" "18 años" NA "18 años" ...
##  $ Q23                  : chr [1:103] "Por favor siga con la encuesta, ¡gracias!" NA NA NA ...
##  $ Q6                   : chr [1:103] "La siguiente sección tiene como proposito que a partir de situación presentada, usted pueda escog..." NA NA NA ...
##  $ Q24                  : chr [1:103] "La siguiente sección tiene como proposito que a partir de situación presentada, usted pueda escoger la opción c"| __truncated__ NA NA NA ...
##  $ Q14                  : chr [1:103] "¿Qué tan importantes son las políticas de transporte?" NA NA "Algo" ...
##  $ Q16                  : chr [1:103] "Me siento motivadx a involucrarme en acciones colectivas relacionadas con la mejora del transporte público." NA NA "Neutral" ...
##  $ Q17                  : chr [1:103] "Creo que mi participación en temas públicos puede generar un cambio" NA NA "En desacuerdo" ...
##  $ Q19                  : chr [1:103] "Estoy dispuestx a firmar o compartir una petición para exigir mejoras en la movilidad urbana" NA NA "Neutral" ...
##  $ Q20                  : chr [1:103] "Creo que la movilidad urbana debería ser una prioridad en la agenda política local" NA NA "De acuerdo" ...
##  $ tx                   : chr [1:103] "tx" "luis_injusticia" "control" "luis" ...
summary(df)           # ¿Valores correctos, sin NA masivos?
##   StartDate           EndDate             Status           IPAddress        
##  Length:103         Length:103         Length:103         Length:103        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##    Progress         Duration (in seconds)   Finished         RecordedDate      
##  Length:103         Length:103            Length:103         Length:103        
##  Class :character   Class :character      Class :character   Class :character  
##  Mode  :character   Mode  :character      Mode  :character   Mode  :character  
##   ResponseId        RecipientLastName  RecipientFirstName RecipientEmail    
##  Length:103         Length:103         Length:103         Length:103        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##  ExternalReference  LocationLatitude   LocationLongitude  DistributionChannel
##  Length:103         Length:103         Length:103         Length:103         
##  Class :character   Class :character   Class :character   Class :character   
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character   
##  UserLanguage            Q8                 Q1                 Q4           
##  Length:103         Length:103         Length:103         Length:103        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##      Q23                 Q6                Q24                Q14           
##  Length:103         Length:103         Length:103         Length:103        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##      Q16                Q17                Q19                Q20           
##  Length:103         Length:103         Length:103         Length:103        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##       tx           
##  Length:103        
##  Class :character  
##  Mode  :character
library(dplyr)

# 1. Eliminar la primera fila de etiquetas (actualmente en fila 1)
df <- df[-1, ]

# 2. Convertir columnas clave
df <- df %>%
  mutate(
    Progress = as.numeric(Progress),
    `Duration (in seconds)` = as.numeric(`Duration (in seconds)`),
    StartDate = as.POSIXct(as.numeric(StartDate), origin = "1899-12-30"),
    EndDate = as.POSIXct(as.numeric(EndDate), origin = "1899-12-30"),
    RecordedDate = as.POSIXct(as.numeric(RecordedDate), origin = "1899-12-30")
  ) %>%
  filter(Finished == "True")
df <- df %>%
  rename(
    genero = Q1,
    edad = Q4,
    consentimiento = Q8,
    politica_transporte = Q14,
    motivacion = Q16,
    cambio_publico = Q17,
    peticion = Q19,
    prioridad_local = Q20
  )
write.csv(df, "encuesta_limpia_final.csv", row.names = FALSE)
head(df, 3)
## # A tibble: 3 × 29
##   StartDate           EndDate             Status         IPAddress     Progress
##   <dttm>              <dttm>              <chr>          <chr>            <dbl>
## 1 1899-12-30 12:43:38 1899-12-30 12:43:38 Survey Preview <NA>               100
## 2 1899-12-30 12:43:38 1899-12-30 12:43:38 Survey Preview <NA>               100
## 3 1899-12-30 12:43:43 1899-12-30 12:43:43 IP Address     189.175.0.159      100
## # ℹ 24 more variables: `Duration (in seconds)` <dbl>, Finished <chr>,
## #   RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
## #   RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
## #   LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
## #   UserLanguage <chr>, consentimiento <chr>, genero <chr>, edad <chr>,
## #   Q23 <chr>, Q6 <chr>, Q24 <chr>, politica_transporte <chr>,
## #   motivacion <chr>, cambio_publico <chr>, peticion <chr>, …

Análisis

unique(df$tx)
## [1] "luis_injusticia" "control"         "luis"
control <- df %>% filter(tx == "control")
tratamiento1 <- df %>% filter(tx == "luis")
tratamiento2 <- df %>% filter(tx == "luis_injusticia")
df <- df %>%
  mutate(grupo = case_when(
    tx == "control" ~ "Control",
    tx == "luis" ~ "Anecdote",
    tx == "luis_injusticia" ~ "Anecdote + Injustice",
    TRUE ~ NA_character_
  ))
table(df$grupo, useNA = "ifany")
## 
##             Anecdote Anecdote + Injustice              Control 
##                   34                   34                   34
library(ggplot2)

ggplot(df, aes(x = grupo, fill = politica_transporte)) +
  geom_bar(position = "fill") +
  labs(
    y = "Proporción",
    x = "Grupo experimental",
    fill = "Importancia del transporte",
    title = "Percepción de importancia del transporte por grupo"
  )

The narrative with an injustice component (Treatment 2) seems to raise more awareness about the importance of transportation policies. The control group shows more moderate views. Treatment 1 also has an effect, but it’s not as strong as Treatment 2.

# Asignar escala numérica
df <- df %>%
  mutate(politica_num = case_when(
    politica_transporte == "Nada" ~ 1,
    politica_transporte == "Poco" ~ 2,
    politica_transporte == "Algo" ~ 3,
    politica_transporte == "Bastante" ~ 4,
    politica_transporte == "Mucho" ~ 5,
    TRUE ~ NA_real_
  ))
# ANOVA
modelo <- aov(politica_num ~ grupo, data = df)
summary(modelo)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2  8.017   4.009   12.92 1.06e-05 ***
## Residuals   97 30.093   0.310                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
escala_likert <- c(
  "Muy en desacuerdo" = 1,
  "En desacuerdo" = 2,
  "Neutral" = 3,
  "De acuerdo" = 4,
  "Muy de acuerdo" = 5
)

df <- df %>%
  mutate(motivacion_num = escala_likert[motivacion])

ANOVA de motivation

modelo_motiv <- aov(motivacion_num ~ grupo, data = df)
summary(modelo_motiv)
##             Df Sum Sq Mean Sq F value  Pr(>F)   
## grupo        2    6.7   3.349   4.975 0.00878 **
## Residuals   97   65.3   0.673                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(modelo_motiv)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = motivacion_num ~ grupo, data = df)
## 
## $grupo
##                                     diff        lwr        upr     p adj
## Anecdote + Injustice-Anecdote  0.3449198 -0.1323194  0.8221590 0.2028361
## Control-Anecdote              -0.2914439 -0.7686831  0.1857954 0.3178458
## Control-Anecdote + Injustice  -0.6363636 -1.1171511 -0.1555761 0.0060891
library(ggplot2)

ggplot(df, aes(x = grupo, y = motivacion_num)) +
  geom_boxplot() +
  labs(
    title = "Motivation to Get Involved by Group",
    y = "Motivation (1 = strongly disagree, 5 = strongly agree)"
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

ggsave("boxplot_motivation.png", 
       ggplot(df, aes(x = grupo, y = motivacion_num)) +
         geom_boxplot() +
         labs(
           title = "Motivation to Get Involved by Group",
           y = "Motivation (1 = strongly disagree, 5 = strongly agree)"
         ),
       width = 8, height = 5, dpi = 300)
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

Treatment Group 2 (Luis + injustice) shows a significant increase in motivation to get involved compared to the Control Group. Treatment Group 1 (Luis without the injustice element) doesn’t show a significant change. There’s no significant difference between the two treatment groups.

Including a structural injustice element in the narrative is what significantly drives political motivation. Just describing a situation isn’t enough.

Pregunta (Q16):

“Me siento motivadx a involucrarme en acciones colectivas relacionadas con la mejora del transporte público.”

Opciones de respuesta:

Muy en desacuerdo

En desacuerdo

Neutral

De acuerdo

Muy de acuerdo

ANOVA cambio_publico

df <- df %>%
  mutate(cambio_publico_num = escala_likert[cambio_publico])
modelo_cambio <- aov(cambio_publico_num ~ grupo, data = df)
summary(modelo_cambio)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2  11.29   5.643    9.13 0.000233 ***
## Residuals   97  59.95   0.618                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(modelo_cambio)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cambio_publico_num ~ grupo, data = df)
## 
## $grupo
##                                     diff        lwr        upr     p adj
## Anecdote + Injustice-Anecdote  0.6096257  0.1523477  1.0669036 0.0056813
## Control-Anecdote              -0.1782531 -0.6355311  0.2790248 0.6240829
## Control-Anecdote + Injustice  -0.7878788 -1.2485566 -0.3272010 0.0002799
ggplot(df, aes(x = grupo, y = cambio_publico_num)) +
  geom_boxplot() +
  labs(
    title = "Percepción de impacto personal en temas públicos",
    y = "Cambio público (1 = muy en desacuerdo, 5 = muy de acuerdo)"
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

Treatment Group 2 (narrative with injustice) significantly increases the belief that participation can lead to change. Treatment Group 1 (neutral narrative) doesn’t differ from the control. Also, Treatment 2 scores higher than Treatment 1, suggesting that highlighting injustice is key to activating political agency. The treatment with injustice not only increases motivation, it also strengthens the perception of political self-efficacy. In other words, people feel more capable of making an impact

Pregunta (Q17):

“Creo que mi participación en temas públicos puede generar un cambio”

Opciones de respuesta:

Muy en desacuerdo

En desacuerdo

Neutral

De acuerdo

Muy de acuerdo

ANOVA petición

df <- df %>%
  mutate(peticion_num = escala_likert[peticion])
modelo_peticion <- aov(peticion_num ~ grupo, data = df)
summary(modelo_peticion)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2   8.73   4.364   8.918 0.000278 ***
## Residuals   97  47.46   0.489                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(modelo_peticion)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = peticion_num ~ grupo, data = df)
## 
## $grupo
##                                     diff         lwr         upr     p adj
## Anecdote + Injustice-Anecdote  0.3609626 -0.04590027  0.76782541 0.0927351
## Control-Anecdote              -0.3663102 -0.77317300  0.04055268 0.0865811
## Control-Anecdote + Injustice  -0.7272727 -1.13716061 -0.31738484 0.0001597
ggplot(df, aes(x = grupo, y = peticion_num)) +
  geom_boxplot() +
  labs(
    title = "Disposición a firmar peticiones por grupo",
    y = "Petición (1 = muy en desacuerdo, 5 = muy de acuerdo)"
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

ggplot(df, aes(x = grupo, y = peticion_num)) +
  geom_boxplot() +
  labs(
    title = "Willingness to Sign Petitions by Group",
    y = "Petition (1 = strongly disagree, 5 = strongly agree)"
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

ggsave("boxplot_petition.png", 
       ggplot(df, aes(x = grupo, y = peticion_num)) +
         geom_boxplot() +
         labs(
           title = "Willingness to Sign Petitions by Group",
           y = "Petition (1 = strongly disagree, 5 = strongly agree)"
         ),
       width = 8, height = 5, dpi = 300)
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

Treatment Group 2 (with injustice) significantly increases the willingness to sign a petition. Treatment 1 (just the narrative) has a weak or non-significant effect. Once again, injustice is the strongest trigger for encouraging collective action. The narrative with injustice not only impacts motivation and the sense of agency, but also leads to a greater willingness to take action (like signing petitions).

Pregunta (Q19):

“Estoy dispuestx a firmar o compartir una petición para exigir mejoras en la movilidad urbana”

Opciones de respuesta:

Muy en desacuerdo

En desacuerdo

Neutral

De acuerdo

Muy de acuerdo

ANOVA prioridad local

df <- df %>%
  mutate(prioridad_local_num = escala_likert[prioridad_local])
modelo_prioridad <- aov(prioridad_local_num ~ grupo, data = df)
summary(modelo_prioridad)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2  14.61   7.307   12.63 1.34e-05 ***
## Residuals   97  56.14   0.579                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(modelo_prioridad)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = prioridad_local_num ~ grupo, data = df)
## 
## $grupo
##                                     diff         lwr         upr     p adj
## Anecdote + Injustice-Anecdote  0.5187166  0.07623917  0.96119399 0.0172825
## Control-Anecdote              -0.4206774 -0.86315477  0.02180005 0.0659981
## Control-Anecdote + Injustice  -0.9393939 -1.38516119 -0.49362669 0.0000071
ggplot(df, aes(x = grupo, y = prioridad_local_num)) +
  geom_boxplot() +
  labs(
    title = "Percepción de prioridad política de la movilidad por grupo",
    y = "Prioridad movilidad (1 = muy en desacuerdo, 5 = muy de acuerdo)"
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

Treatment Group 2 (Luis + injustice) sees urban mobility as a higher priority compared to the other groups. Treatment 1 (Luis) also shows a higher perception than the control group, although it doesn’t reach 95% significance. The control group reports the lowest perception of priority. Results show that the group exposed to the injustice case (Treatment 2) sees urban mobility as a significantly more important local political issue compared to both the control group and the neutral case (Treatment 1). This suggests that highlighting social injustice clearly increases the perceived urgency of the issue. Treatment 1 also raises this perception, but not significantly.

Pregunta (Q20): “Creo que la movilidad urbana debería ser una prioridad en la agenda política local” Opciones de respuesta: 1 = Muy en desacuerdo 2 = En desacuerdo 3 = Neutral 4 = De acuerdo 5 = Muy de acuerdo

ANOVA importancia del transporte

# ANOVA
modelo_politica <- aov(politica_num ~ grupo, data = df)
summary(modelo_politica)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2  8.017   4.009   12.92 1.06e-05 ***
## Residuals   97 30.093   0.310                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
# Comparaciones post-hoc
TukeyHSD(modelo_politica)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = politica_num ~ grupo, data = df)
## 
## $grupo
##                                     diff         lwr         upr     p adj
## Anecdote + Injustice-Anecdote  0.3582888  0.03432016  0.68225738 0.0264513
## Control-Anecdote              -0.3386809 -0.66264954 -0.01471232 0.0383071
## Control-Anecdote + Injustice  -0.6969697 -1.02334703 -0.37059237 0.0000054

The control group (no message) rated transportation as less important. Treatment 1 (informative message) led to a slight increase. Treatment 2 (message with injustice) produced a greater increase in perceived importance. The type of message has a significant effect on how important transportation policies are perceived. The group that received the message emphasizing injustice (Treatment 2) rated it highest, followed by the informative group (Treatment 1), while the control group scored lowest.

Q14: ¿Qué tan importantes son las políticas de transporte?

Opciones de respuesta:

Muy en desacuerdo

En desacuerdo

Neutral

De acuerdo

Muy de acuerdo

# Variables significativas
vars_significativas <- c(
  "politica_num",
  "motivacion_num",
  "cambio_publico_num",
  "peticion_num",
  "prioridad_local_num"
)

# Calcular media y error estándar por grupo y variable
df_summary <- df %>%
  select(grupo, all_of(vars_significativas)) %>%
  pivot_longer(-grupo, names_to = "variable", values_to = "valor") %>%
  group_by(variable, grupo) %>%
  summarise(
    media = mean(as.numeric(valor), na.rm = TRUE),
    se = sd(as.numeric(valor), na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  ) %>%
  mutate(
    variable = recode(variable,
      politica_num = "Importance of policies",
      motivacion_num = "Collective motivation",
      cambio_publico_num = "Public change",
      peticion_num = "Petition",
      prioridad_local_num = "Local priority"
    )
  )

# Gráfico
ggplot(df_summary, aes(x = grupo, y = media, color = grupo)) +
  geom_pointrange(aes(ymin = media - se, ymax = media + se), size = 0.9, position = position_dodge(width = 0.4)) +
  facet_wrap(~ variable, scales = "free_y") +
  labs(
    title = "Group comparison: mean ± standard error",
    y = "Score (1 to 5)",
    x = "Experimental group"
  ) +
  theme_minimal(base_size = 13) +
  theme(legend.position = "none")

# Guardar gráfico
ggsave("comparacion_grupos.png", width = 10, height = 6, dpi = 300)

Rojo → Grupo Control

Verde → Tratamiento 1 (solo información)

Azul → Tratamiento 2 (información + injusticia)

El punto es la media (promedio) de respuestas en esa variable para el grupo.

La línea vertical representa el error estándar de esa media. Cuanto más larga la línea, mayor la incertidumbre sobre ese promedio.

¿Cómo leerlo? Si un grupo tiene un punto más arriba, significa que su promedio es mayor (ej. más acuerdo o más percepción).

Si las líneas (barras de error) no se traslapan mucho, es una indicación visual de que hay diferencia estadística significativa (¡pero recuerda, eso lo confirma ANOVA/Tukey!).

1. Public Change

“I believe my participation in public issues can create change.”
- Treatment 2 (injustice) shows a clearly higher average than the other two.
- Treatment 1 ≈ Control, with no meaningful difference.
Interpretation: People believe their participation can make a difference only when injustice is shown.

2. Policy Importance

“How important are transportation policies?”
- Treatment 2 > Treatment 1 > Control.
- The more information people receive — especially about injustice — the more important they see transportation policies.
Interpretation: Information increases perceived importance, and injustice makes the biggest difference.

3. Collective Motivation

“I feel motivated to join collective actions…”
- Treatment 2 stands out again, well above the others.
- Treatment 1 shows a small improvement vs. Control, but it’s minor.
Interpretation: Injustice significantly increases motivation for collective action.

4. Petition

“I’m willing to sign or share a petition…”
- Treatment 2 has the highest average, with a significant difference.
- Control is lowest; Treatment 1 is slightly in between.
Interpretation: Willingness to act (e.g., signing) increases only with the emotional impact of injustice.

5. Local Priority

“Urban mobility should be a local political priority.”
- Clear pattern: Treatment 2 > Treatment 1 > Control.
Interpretation: The more information people get, the more they see mobility as a political priority.

Overall Conclusion

analisis de Q19 peticiones

escala_likert <- c(
  "Muy en desacuerdo" = 1,
  "En desacuerdo" = 2,
  "Neutral" = 3,
  "De acuerdo" = 4,
  "Muy de acuerdo" = 5
)

df <- df %>%
  mutate(peticion_num = escala_likert[peticion])
df %>%
  group_by(grupo) %>%
  summarise(
    n = n(),
    media = mean(peticion_num, na.rm = TRUE),
    sd = sd(peticion_num, na.rm = TRUE),
    se = sd / sqrt(n)
  )
## # A tibble: 3 × 5
##   grupo                    n media    sd     se
##   <chr>                <int> <dbl> <dbl>  <dbl>
## 1 Anecdote                34  3.91 0.570 0.0978
## 2 Anecdote + Injustice    34  4.27 0.626 0.107 
## 3 Control                 34  3.55 0.869 0.149
modelo_peticion <- aov(peticion_num ~ grupo, data = df)
summary(modelo_peticion)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## grupo        2   8.73   4.364   8.918 0.000278 ***
## Residuals   97  47.46   0.489                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(modelo_peticion)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = peticion_num ~ grupo, data = df)
## 
## $grupo
##                                     diff         lwr         upr     p adj
## Anecdote + Injustice-Anecdote  0.3609626 -0.04590027  0.76782541 0.0927351
## Control-Anecdote              -0.3663102 -0.77317300  0.04055268 0.0865811
## Control-Anecdote + Injustice  -0.7272727 -1.13716061 -0.31738484 0.0001597
library(ggplot2)
df_summary <- df %>%
  group_by(grupo) %>%
  summarise(
    media = mean(peticion_num, na.rm = TRUE),
    se = sd(peticion_num, na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  )

ggplot(df_summary, aes(x = grupo, y = media)) +
  geom_col(fill = "steelblue", width = 0.6) +
  geom_errorbar(aes(ymin = media - se, ymax = media + se), width = 0.2) +
  labs(
    title = "Willingness to Sign a Petition by Group",
    x = "Experimental Group",
    y = "Mean Response (1–5)"
  ) +
  theme_minimal()

Treatment 2 (injustice) significantly increased students’ willingness to sign or share a petition compared to the control group (p < 0.001). Treatment 1 (neutral message) showed a small increase over the control, but the difference was not statistically significant. While Treatment 2 also outperformed Treatment 1, the difference was marginal (p ≈ 0.09). These findings suggest that emphasizing social injustice has a clear emotional impact that translates into greater political engagement, even in low-effort actions like signing a petition.

Control tiene la media más baja (3.55/5), con mayor incertidumbre (barra de error más amplia).