Teilnehmerinnenstudie: GenVal, PersVal und EpistConv


Worum geht’s?

In diesem Dokument werden die Skalen für die abhängigen Variablen GenVal, PersVal und EpistConv in der Gruppe der Teilnehmerinnen aufgestellt.

Zunächst werden die Kategorienhäufigkeiten jedes Item dargestellt und die aggregierte Variable wird als Mittelwert gebildet. Cronbachs Alpha (raw α, die interne Konsitenz) gibt Aufschluss über die Reliabilität. Die Berechnung wird für die zwei Zeitpunkte gemacht t0 (grün) und t1 (blau).

Anschließend wird die Verteilung auf Normalverteilung geprüft, da dies eine Voraussetzung für einen abhängigen t-Test ist. Die Prüfung kann graphisch mit einem Q-Q-Plot oder analytisch mit einem Shapiro Wilk-Test (nur für N < 50) erfolgen.

Anschließend wird der gesamte Vorgang für den Complete Case widerholt. In der Complete Case Analysis werden nur Fälle berücksichtigt, bei denen für beide Zeitpunkte t0 und t1 Daten vorliegen, wo der Panelcode also matcht (One-Hot-Encoding in der Spalte cca).


Pakete laden

knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(kableExtra)
library(knitr)
library(plotly)
library(dplyr)
library(htmltools)
print('Pakete geladen')
## [1] "Pakete geladen"


JavaScript Funktionen und CSS laden

print('JavaScript Funktion geladen.')
## [1] "JavaScript Funktion geladen."


Datensatz auswählen

# Subset einlesen (nur Pre- und Post-Daten)
data_subset_PrePost <- all %>%
  filter(Zeitpunkt %in% c("Pre", "Post"),
         Jahrgang %in% c("TN 2023", "TN 2024", "TN 2025"))

# Subset einlesen (nur complete case)
data_subset_cca <- all %>%
  filter(Zeitpunkt %in% c("Pre", "Post"),
         complete == '1',
         Jahrgang %in% c("TN 2023", "TN 2024", "TN 2025"))


Funktionen definieren

catfreq <- function(d,c) {
  var_name <- deparse(substitute(c))
  summarise(d,
            'v' = var_name,
            '#1'=sum({{c}}==1, na.rm = TRUE),
            '#2'=sum({{c}}==2, na.rm = TRUE),
            '#3'=sum({{c}}==3, na.rm = TRUE),
            '#4'=sum({{c}}==4, na.rm = TRUE),
            '#5'=sum({{c}}==5, na.rm = TRUE),
            '#6'=sum({{c}}==6, na.rm = TRUE),
            '#7'=sum({{c}}==7, na.rm = TRUE),
            sum = sum({{c}} %in% 1:7),
            sumNA=sum(is.na({{c}})),
            N =length({{c}}),
            Median = round(median({{c}}, na.rm = TRUE), digits = 2),
            Mittelwert = round(mean({{c}}, na.rm = TRUE),digits=2),
            Itemschwierigkeit = round(Mittelwert/7, digits=2),
            Standardabweichung =round(sd({{c}}, na.rm = TRUE),  digits=2)
            )
}

create_bar_plot <- function(df, var_name, y_max) {
  p <- df %>%
    filter(!is.na(!!sym(var_name))) %>% 
    mutate(Zeitpunkt = factor(Zeitpunkt, levels = c("Pre", "Post"))) %>% 
    ggplot(aes(x = factor(!!sym(var_name)), fill = Zeitpunkt)) +
    geom_bar(position = position_dodge(preserve = "single")) +
    scale_fill_manual(
      labels = c(expression(t[0]), expression(t[1])), 
      values = c("#B1C800", "#006E89"),
      drop = FALSE,
      #guide = guide_legend(reverse = TRUE)
    ) +
    scale_x_discrete(
      breaks = as.character(1:7),
      limits = as.character(1:7),
      drop = FALSE
    ) +
    scale_y_continuous(
      breaks = seq(0, y_max, by = 5),
      minor_breaks = seq(0, y_max, by = 1),
      limits = c(0, y_max), 
      expand = expansion(mult = c(0, 0.05))
    ) +
    labs(
      x = "Likert-Skala",
      y = "Absolute Häufigkeit", 
      fill = "Zeitpunkt",
      title = paste(var_name,'(Einzelitem)')
    ) +
    theme_classic() +
    theme(
      axis.title.x = element_text(vjust = -2), 
      axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 0, unit = "pt")),
    )
  
  return(p)
}
        
create_box_plot <- function(df, var_name, y_label) {
  p <- df %>%
    ggplot(aes_string(x = var_name, fill = "Zeitpunkt")) +
    geom_boxplot() +
    scale_x_discrete(
      breaks = as.character(1:7),
      limits = as.character(1:7),
      drop = FALSE
    ) +
    scale_fill_manual(
      labels = c(expression(t[1]), expression(t[0])),
      values = c("#006E89", "#B1C800"),
      limits = c("Post", "Pre"),
      guide = guide_legend(reverse = TRUE)
    ) +
    labs(
      x = "Likert-Skala",
      y = y_label, 
      title = paste(var_name,'(aggregierte Variable)')
    ) +
    theme_classic() +
    theme(
      axis.title.x = element_text(vjust = -2),
      axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 12, unit = "pt")),
      axis.ticks.y = element_blank(),
      axis.text.y = element_blank()
    )
  
  return(p)
}

create_density_plot <- function(df, var){
  p <- df %>%
    ggplot(aes(x = factor(.data[[var]]), fill = Zeitpunkt)) +
    geom_density(aes(group = Zeitpunkt), alpha = 0.5, linewidth = 0.3) +
    labs(
      title = paste(var, "Kernel-Dichte-Schätzung"),
      x = "Likert-Skala",
      y = "Dichte",
      fill = "Zeitpunkt"
    ) +
    scale_x_discrete(
      breaks = as.character(1:7),
      limits = as.character(1:7),
      drop = FALSE
    ) +
    scale_fill_manual(values = c('#006E89', '#B1C800')) +
    theme_minimal() +
    guides(fill = guide_legend(reverse = TRUE))
  return(p)
}

print('Funktionen definiert.')
## [1] "Funktionen definiert."



Alle Daten aus Pre und Post

Kategorienhäufigkeiten

GenVal - Genereller Wert der Naturwissenschaften

# Cronbachs Alpha
alpha_pre  <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',112:116]|>
  psych::alpha()
alpha_post <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',112:116]|>
  psych::alpha()

# Mittelwerte etc.

v_pre <- c('GenVal (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),   digits=2)
           )

v_post <- c('GenVal (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 112:116], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),   digits=2)
            )

# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[112:116],
      c(
      'Die Naturwissenschaften sind wichtig, um uns zu helfen, die Welt der Natur zu verstehen.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich verbessern gewöhnlich die Lebensbedingungen der Menschen.',
      'Die Naturwissenschaft hat eine große Bedeutung für die Gesellschaft.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich haben gewöhnlich eine positive Auswirkung auf die Wirtschaft.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich produzieren gewöhnlich Vorteile auf sozialer Ebene.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
GenVal1 Die Naturwissenschaften sind wichtig, um uns zu helfen, die Welt der Natur zu verstehen.
GenVal2 Die Fortschritte im naturwissenschaftlichen und technischen Bereich verbessern gewöhnlich die Lebensbedingungen der Menschen.
GenVal3 Die Naturwissenschaft hat eine große Bedeutung für die Gesellschaft.
GenVal4 Die Fortschritte im naturwissenschaftlichen und technischen Bereich haben gewöhnlich eine positive Auswirkung auf die Wirtschaft.
GenVal5 Die Fortschritte im naturwissenschaftlichen und technischen Bereich produzieren gewöhnlich Vorteile auf sozialer Ebene.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),
      
  cbind(
    rbind(
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],GenVal1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],GenVal2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],GenVal3),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],GenVal4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],GenVal5),
    v_pre,
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],GenVal1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],GenVal2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],GenVal3),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],GenVal4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],GenVal5),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") # Post
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
GenVal1 0 1 1 3 12 16 46 79 0 79 7 6.27 0.9 1.07 0.68 0.56
GenVal2 0 0 5 12 28 17 17 79 0 79 5 5.37 0.77 1.17 0.51 0.45
GenVal3 0 0 2 8 17 21 31 79 0 79 6 5.9 0.84 1.12 0.66 0.54
GenVal4 0 2 7 17 16 22 15 79 0 79 5 5.19 0.74 1.35 0.52 0.46
GenVal5 1 4 11 25 18 13 6 78 1 79 4 4.51 0.64 1.35 0.65 0.57
GenVal (Skala) 79 5.45 0.78 0.86 raw α 0.75
GenVal1 0 0 1 2 14 9 42 68 1 69 7 6.31 0.9 1 0.61 0.54
GenVal2 0 2 2 16 22 15 12 69 0 69 5 5.19 0.74 1.23 0.83 0.75
GenVal3 0 1 0 4 20 16 28 69 0 69 6 5.94 0.85 1.08 0.59 0.49
GenVal4 1 3 3 8 28 13 10 66 3 69 5 5.09 0.73 1.33 0.58 0.51
GenVal5 2 2 3 28 20 9 5 69 0 69 4 4.58 0.65 1.25 0.71 0.63
GenVal (Skala) 69 5.42 0.77 0.88 raw α 0.8
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_PrePost, 'GenVal1', 75)
ggsave("bilder/GenVal1.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'GenVal2', 75)
ggsave("bilder/GenVal2.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'GenVal3', 75)
ggsave("bilder/GenVal3.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'GenVal4', 75)
ggsave("bilder/GenVal4.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'GenVal5', 75)
ggsave("bilder/GenVal5.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_PrePost, "GenVal", " ")
ggsave("bilder/GenVal.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_PrePost,'GenVal')
ggsave("bilder/GenVal_den.png", plot = p, width = 10, height = 6, units = "cm")




PersVal - Persönlicher Wert der Naturwissenschaften

# Cronbachs Alpha
alpha_pre  <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',117:121]|>
  psych::alpha()
alpha_pre  <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',117:121]|>
  psych::alpha()

# Mittelwerte etc.

v_pre <- c('PersVal (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),   digits=2)
           )

v_post <- c('PersVal (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 117:121], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),   digits=2)
            )  
  
# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[117:121],
      c(
      'Ich glaube, dass die Naturwissenschaften mir helfen, die Dinge, die mich umgeben zu verstehen.',
      'In meinem späteren Leben werde ich die naturwissenschaftlichen Kenntnisse in verschiedener Weise anwenden.',
      'Einige naturwissenschaftliche Begriffe helfen mir zu verstehen, wie ich mich gegenüber anderen verhalte.',
      'Sobald ich die Schule abgeschlossen habe, werde ich viele Gelegenheiten haben, meine naturwissenschaftlichen Kenntnisse anzuwenden.',
      'Für mich ist die Naturwissenschaft sehr wichtig.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
PersVal1 Ich glaube, dass die Naturwissenschaften mir helfen, die Dinge, die mich umgeben zu verstehen.
PersVal2 In meinem späteren Leben werde ich die naturwissenschaftlichen Kenntnisse in verschiedener Weise anwenden.
PersVal3 Einige naturwissenschaftliche Begriffe helfen mir zu verstehen, wie ich mich gegenüber anderen verhalte.
PersVal4 Sobald ich die Schule abgeschlossen habe, werde ich viele Gelegenheiten haben, meine naturwissenschaftlichen Kenntnisse anzuwenden.
PersVal5 Für mich ist die Naturwissenschaft sehr wichtig.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),
      
  cbind(
    rbind(
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],PersVal1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],PersVal2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],PersVal3),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],PersVal4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],PersVal5),
    v_pre,
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],PersVal1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],PersVal2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],PersVal3),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],PersVal4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],PersVal5),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") # Post
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
PersVal1 0 1 2 9 12 21 34 79 0 79 6 5.92 0.85 1.22 0.61 0.52
PersVal2 0 1 4 17 21 17 19 79 0 79 5 5.34 0.76 1.27 0.68 0.61
PersVal3 4 14 11 16 20 10 4 79 0 79 4 4.01 0.57 1.6 0.62 0.56
PersVal4 1 3 12 22 19 12 10 79 0 79 5 4.66 0.67 1.41 0.69 0.61
PersVal5 0 0 3 13 18 28 17 79 0 79 6 5.54 0.79 1.12 0.8 0.71
PersVal (Skala) 79 5.1 0.73 0.94 raw α 0.81
PersVal1 1 1 2 4 18 18 25 69 0 69 6 5.77 0.82 1.3 0.61 0.54
PersVal2 1 3 5 17 15 17 11 69 0 69 5 4.99 0.71 1.44 0.83 0.75
PersVal3 5 10 14 14 11 7 7 68 1 69 4 3.96 0.57 1.73 0.59 0.49
PersVal4 2 5 11 17 15 12 7 69 0 69 4 4.48 0.64 1.53 0.58 0.51
PersVal5 0 2 3 13 18 18 15 69 0 69 5 5.33 0.76 1.29 0.71 0.63
PersVal (Skala) 69 4.91 0.7 1.1 raw α 0.8
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_PrePost, 'PersVal1', 75)
ggsave("bilder/PersVal1.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'PersVal2', 75)
ggsave("bilder/PersVal2.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'PersVal3', 75)
ggsave("bilder/PersVal3.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'PersVal4', 75)
ggsave("bilder/PersVal4.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'PersVal5', 75)
ggsave("bilder/PersVal5.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_PrePost, "PersVal", " ")
ggsave("bilder/PersVal.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_PrePost,'PersVal')
ggsave("bilder/PersVal_den.png", plot = p, width = 10, height = 6, units = "cm")




EpistConv - Erkenntnistheoretische Überzeugungen

# Cronbachs Alpha ohne EpistConv3, da negativ korreliert
alpha_pre  <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',c(122:123,125:127)]|>
  psych::alpha()
alpha_pre  <- data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',c(122:123,125:127)]|>
  psych::alpha()

# Mittelwerte etc. # ohne EpistConv3, da negativ korreliert




v_pre <- c('EpistConv (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),   digits=2)
           )

v_post <- c('EpistConv (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),   digits=2)
            )  

# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[122:127],
      c(
      'Eine gute Möglichkeit herauszufinden, ob etwas wahr ist, ist ein Experiment durchzuführen.',
      'Naturwissenschaftliche Erkenntnisse ändern sich manchmal.',
      'Gute Antworten basieren auf Befunden aus vielen unterschiedlichen Experimenten.',
      'Es ist gut Experimente mehrmals durchzuführen, um sicherzustellen, dass die Ergebnisse stimmen.',
      'Manchmal ändern Wissenschaftler*innen ihre Meinung über das, was in den Naturwissenschaften wahr ist.',
      'Erkenntnisse in naturwissenschaftlichen Fachbüchern ändern sich manchmal.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
EpistConv1 Eine gute Möglichkeit herauszufinden, ob etwas wahr ist, ist ein Experiment durchzuführen.
EpistConv2 Naturwissenschaftliche Erkenntnisse ändern sich manchmal.
EpistConv3 Gute Antworten basieren auf Befunden aus vielen unterschiedlichen Experimenten.
EpistConv4 Es ist gut Experimente mehrmals durchzuführen, um sicherzustellen, dass die Ergebnisse stimmen.
EpistConv5 Manchmal ändern Wissenschaftler*innen ihre Meinung über das, was in den Naturwissenschaften wahr ist.
EpistConv6 Erkenntnisse in naturwissenschaftlichen Fachbüchern ändern sich manchmal.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),
      
  cbind(
    rbind(
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],EpistConv1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],EpistConv2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],EpistConv4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],EpistConv5),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',],EpistConv6),
    v_pre,
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],EpistConv1),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],EpistConv2),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],EpistConv4),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],EpistConv5),
    catfreq(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',],EpistConv6),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") %>% # Post
  footnote(general = paste0('EpistConv3 wurde aufgrund negativer Korrelation entfernt.'), general_title = "Anmerkung:")
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
EpistConv1 0 1 4 9 19 23 23 79 0 79 6 5.62 0.8 1.23 0.52 0.46
EpistConv2 0 1 0 6 13 23 36 79 0 79 6 6.09 0.87 1.06 0.77 0.69
EpistConv4 0 0 1 2 7 17 52 79 0 79 7 6.48 0.93 0.86 0.55 0.5
EpistConv5 1 1 4 8 18 19 28 79 0 79 6 5.66 0.81 1.37 0.72 0.66
EpistConv6 0 0 2 4 12 20 41 79 0 79 7 6.19 0.88 1.04 0.78 0.7
EpistConv (Skala) 79 6.01 0.86 0.77 raw α 0.8
EpistConv1 0 1 1 9 20 12 26 69 0 69 6 5.72 0.82 1.22 0.61 0.54
EpistConv2 0 1 0 2 11 12 43 69 0 69 7 6.35 0.91 1.01 0.83 0.75
EpistConv4 0 0 0 1 3 8 57 69 0 69 7 6.75 0.96 0.6 0.59 0.49
EpistConv5 0 1 2 6 14 10 35 68 1 69 7 5.99 0.86 1.26 0.58 0.51
EpistConv6 0 0 1 8 10 8 42 69 0 69 7 6.19 0.88 1.15 0.71 0.63
EpistConv (Skala) 69 6.2 0.89 0.8 raw α 0.8
Anmerkung:
EpistConv3 wurde aufgrund negativer Korrelation entfernt.
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_PrePost, 'EpistConv1', 75)
ggsave("bilder/EpistConv1.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'EpistConv2', 75)
ggsave("bilder/EpistConv2.png", plot = p, width = 10, height = 6, units = "cm")

#p <- create_bar_plot(data_subset_PrePost, 'EpistConv3', 75)
#ggsave("bilder/EpistConv3.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'EpistConv4', 75)
ggsave("bilder/EpistConv4.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'EpistConv5', 75)
ggsave("bilder/EpistConv5.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_PrePost, 'EpistConv6', 75)
ggsave("bilder/EpistConv6.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_PrePost, "EpistConv", " ")
ggsave("bilder/EpistConv.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_PrePost,'EpistConv')
ggsave("bilder/EpistConv_den.png", plot = p, width = 10, height = 6, units = "cm")




Normalitätstest

Q-Q-Plots

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',], aes(sample=zGenVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="GenVal, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_GenValt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',], aes(sample=zGenVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="GenVal, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_GenValt1.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',], aes(sample=zPersVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="PersVal, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_PersValt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',], aes(sample=zPersVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="PersVal, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_PersValt1.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Pre',], aes(sample=zEpistConv)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="EpistConv, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_EpistConvt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_PrePost[data_subset_PrePost$Zeitpunkt == 'Post',], aes(sample=zEpistConv)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="EpistConv, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_EpistConvt1.png", plot = p, width = 10, height = 6, units = "cm")

Complete Case Analysis

Kategorienhäufigkeiten

#Spalten initialisieren
cca$GenVal_t0 <- NA
cca$GenVal_t1 <- NA
cca$PersVal_t0 <- NA
cca$PersVal_t1 <- NA
cca$EpistConv_t0 <- NA
cca$EpistConv_t1 <- NA

# GenVal in cca füllen

# TN 2023 Prä cca
cca$GenVal_t0[1:22] <- all$GenVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2023 Post cca
cca$GenVal_t1[1:22] <- all$GenVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22],
all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2024 Prä cca
cca$GenVal_t0[23:30] <- all$GenVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2024 Post cca
cca$GenVal_t1[23:30] <- all$GenVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2025 Prä cca
cca$GenVal_t0[23:30] <- all$GenVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

# TN 2025 Post cca
cca$GenVal_t1[23:30] <- all$GenVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

# PersVal in cca füllen

# TN 2023 Prä cca
cca$PersVal_t0[1:22] <- all$PersVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2023 Post cca
cca$PersVal_t1[1:22] <- all$PersVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22],
all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2024 Prä cca
cca$PersVal_t0[23:30] <- all$PersVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2024 Post cca
cca$PersVal_t1[23:30] <- all$PersVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2025 Prä cca
cca$PersVal_t0[23:30] <- all$PersVal[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

# TN 2025 Post cca
cca$PersVal_t1[23:30] <- all$PersVal[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

# EpistConv in cca füllen

# TN 2023 Prä cca
cca$EpistConv_t0[1:22] <- all$EpistConv[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2023 Post cca
cca$EpistConv_t1[1:22] <- all$EpistConv[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')][match(cca$Panelcode[1:22],
all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2023") & (all$complete=='1')])]

# TN 2024 Prä cca
cca$EpistConv_t0[23:30] <- all$EpistConv[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2024 Post cca
cca$EpistConv_t1[23:30] <- all$EpistConv[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2024") & (all$complete=='1')])]

# TN 2025 Prä cca
cca$EpistConv_t0[23:30] <- all$EpistConv[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Pre") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

# TN 2025 Post cca
cca$EpistConv_t1[23:30] <- all$EpistConv[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')][match(cca$Panelcode[23:30], all$Panelcode[(all$Zeitpunkt == "Post") & (all$Jahrgang == "TN 2025") & (all$complete=='1')])]

GenVal - Genereller Wert der Naturwissenschaften

# Cronbachs Alpha
alpha_pre  <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',112:116]|>
  psych::alpha()
alpha_post <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',112:116]|>
  psych::alpha()

# Mittelwerte etc.
                    
v_pre <- c('GenVal (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 112:116], na.rm=TRUE)),   digits=2)
           )

v_post <- c('GenVal (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 112:116], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 112:116], na.rm=TRUE)),   digits=2)
            )

# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[112:116],
      c(
      'Die Naturwissenschaften sind wichtig, um uns zu helfen, die Welt der Natur zu verstehen.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich verbessern gewöhnlich die Lebensbedingungen der Menschen.',
      'Die Naturwissenschaft hat eine große Bedeutung für die Gesellschaft.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich haben gewöhnlich eine positive Auswirkung auf die Wirtschaft.',
      'Die Fortschritte im naturwissenschaftlichen und technischen Bereich produzieren gewöhnlich Vorteile auf sozialer Ebene.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
GenVal1 Die Naturwissenschaften sind wichtig, um uns zu helfen, die Welt der Natur zu verstehen.
GenVal2 Die Fortschritte im naturwissenschaftlichen und technischen Bereich verbessern gewöhnlich die Lebensbedingungen der Menschen.
GenVal3 Die Naturwissenschaft hat eine große Bedeutung für die Gesellschaft.
GenVal4 Die Fortschritte im naturwissenschaftlichen und technischen Bereich haben gewöhnlich eine positive Auswirkung auf die Wirtschaft.
GenVal5 Die Fortschritte im naturwissenschaftlichen und technischen Bereich produzieren gewöhnlich Vorteile auf sozialer Ebene.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),
      
  cbind(
    rbind(
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],GenVal1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],GenVal2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],GenVal3),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],GenVal4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],GenVal5),
    v_pre,
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],GenVal1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],GenVal2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],GenVal3),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],GenVal4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],GenVal5),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") # Post
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
GenVal1 0 0 0 0 8 9 28 45 0 45 7 6.44 0.92 0.78 0.71 0.58
GenVal2 0 0 2 9 17 7 10 45 0 45 5 5.31 0.76 1.16 0.36 0.32
GenVal3 0 0 1 5 10 9 20 45 0 45 6 5.93 0.85 1.16 0.74 0.58
GenVal4 0 1 5 6 12 12 9 45 0 45 5 5.24 0.75 1.35 0.62 0.52
GenVal5 0 2 7 15 9 7 4 44 1 45 4 4.55 0.65 1.32 0.54 0.48
GenVal (Skala) 45 5.5 0.79 0.81 raw α 0.72
GenVal1 0 0 1 1 9 6 27 44 1 45 7 6.3 0.9 1.02 0.67 0.61
GenVal2 0 2 1 9 15 9 9 45 0 45 5 5.22 0.75 1.29 0.82 0.76
GenVal3 0 1 0 3 13 11 17 45 0 45 6 5.87 0.84 1.14 0.68 0.6
GenVal4 0 3 3 4 19 7 8 44 1 45 5 5.09 0.73 1.38 0.67 0.61
GenVal5 1 0 1 19 16 3 5 45 0 45 5 4.73 0.68 1.16 0.76 0.69
GenVal (Skala) 45 5.44 0.78 0.94 raw α 0.84
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_cca, 'GenVal1', 30)
ggsave("bilder/GenVal1cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'GenVal2', 30)
ggsave("bilder/GenVal2cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'GenVal3', 30)
ggsave("bilder/GenVal3cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'GenVal4', 30)
ggsave("bilder/GenVal4cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'GenVal5', 30)
ggsave("bilder/GenVal5cca.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_cca, "GenVal", "")
ggsave("bilder/GenValcca.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_cca,'GenVal')
ggsave("bilder/GenValcca_den.png", plot = p, width = 10, height = 6, units = "cm")




PersVal - Persönlicher Wert der Naturwissenschaften

# Cronbachs Alpha
alpha_pre  <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',117:121]|>
  psych::alpha()
alpha_pre  <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',117:121]|>
  psych::alpha()

# Mittelwerte etc.

v_pre <- c('PersVal (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', 117:121], na.rm=TRUE)),   digits=2)
           )

v_post <- c('PersVal (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 117:121], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', 117:121], na.rm=TRUE)),   digits=2)
            )  
  
# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[117:121],
      c(
      'Ich glaube, dass die Naturwissenschaften mir helfen, die Dinge, die mich umgeben zu verstehen.',
      'In meinem späteren Leben werde ich die naturwissenschaftlichen Kenntnisse in verschiedener Weise anwenden.',
      'Einige naturwissenschaftliche Begriffe helfen mir zu verstehen, wie ich mich gegenüber anderen verhalte.',
      'Sobald ich die Schule abgeschlossen habe, werde ich viele Gelegenheiten haben, meine naturwissenschaftlichen Kenntnisse anzuwenden.',
      'Für mich ist die Naturwissenschaft sehr wichtig.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
PersVal1 Ich glaube, dass die Naturwissenschaften mir helfen, die Dinge, die mich umgeben zu verstehen.
PersVal2 In meinem späteren Leben werde ich die naturwissenschaftlichen Kenntnisse in verschiedener Weise anwenden.
PersVal3 Einige naturwissenschaftliche Begriffe helfen mir zu verstehen, wie ich mich gegenüber anderen verhalte.
PersVal4 Sobald ich die Schule abgeschlossen habe, werde ich viele Gelegenheiten haben, meine naturwissenschaftlichen Kenntnisse anzuwenden.
PersVal5 Für mich ist die Naturwissenschaft sehr wichtig.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),

  cbind(
    rbind(
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],PersVal1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],PersVal2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],PersVal3),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],PersVal4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],PersVal5),
    v_pre,
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],PersVal1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],PersVal2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],PersVal3),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],PersVal4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],PersVal5),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") # Post
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
PersVal1 0 1 1 4 11 10 18 45 0 45 6 5.82 0.83 1.25 0.66 0.61
PersVal2 0 1 1 9 14 7 13 45 0 45 5 5.42 0.77 1.29 0.74 0.69
PersVal3 3 8 7 7 12 5 3 45 0 45 4 3.98 0.57 1.69 0.7 0.65
PersVal4 0 2 4 10 15 7 7 45 0 45 5 4.93 0.7 1.34 0.77 0.71
PersVal5 0 0 1 9 11 14 10 45 0 45 6 5.51 0.79 1.12 0.82 0.75
PersVal (Skala) 45 5.13 0.73 0.93 raw α 0.86
PersVal1 0 1 1 3 13 14 13 45 0 45 6 5.71 0.82 1.16 0.67 0.61
PersVal2 1 2 4 12 9 11 6 45 0 45 5 4.84 0.69 1.48 0.82 0.76
PersVal3 1 10 7 11 5 5 5 44 1 45 4 4 0.57 1.71 0.68 0.6
PersVal4 2 3 7 10 8 9 6 45 0 45 5 4.56 0.65 1.66 0.67 0.61
PersVal5 0 2 2 9 13 12 7 45 0 45 5 5.16 0.74 1.3 0.76 0.69
PersVal (Skala) 45 4.85 0.69 1.17 raw α 0.84
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_cca, 'PersVal1', 30)
ggsave("bilder/PersVal1cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'PersVal2', 30)
ggsave("bilder/PersVal2cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'PersVal3', 30)
ggsave("bilder/PersVal3cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'PersVal4', 30)
ggsave("bilder/PersVal4cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'PersVal5', 30)
ggsave("bilder/PersVal5cca.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_cca, "PersVal", "")
ggsave("bilder/PersValcca.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_cca,'PersVal')
ggsave("bilder/PersValcca_den.png", plot = p, width = 10, height = 6, units = "cm")




EpistConv - Erkenntnistheoretische Überzeugungen

# Cronbachs Alpha ohne EpistConv3, da negativ korreliert
alpha_pre  <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',c(122:123,125:127)]|>
  psych::alpha()
alpha_pre  <- data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',c(122:123,125:127)]|>
  psych::alpha()

# Mittelwerte etc.

v_pre <- c('EpistConv (Skala)',
           '','','','','','','','','',
           length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),
           '',
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),   digits=2),
           round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE))/7, digits=2),
           round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre', c(122:123,125:127)], na.rm=TRUE)),   digits=2)
           )

v_post <- c('EpistConv (Skala)',
            '','','','','','','','','',
            length(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),
            '',
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),   digits=2),
            round(mean(rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE))/7, digits=2),
            round(sd  (rowMeans(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', c(122:123,125:127)], na.rm=TRUE)),   digits=2)
            )  
  
# Itemtabelle

kable(caption ='',
      col.names = c('Variable', 'Text'),
cbind(names(all)[122:127],
      c(
      'Eine gute Möglichkeit herauszufinden, ob etwas wahr ist, ist ein Experiment durchzuführen.',
      'Naturwissenschaftliche Erkenntnisse ändern sich manchmal.',
      'Gute Antworten basieren auf Befunden aus vielen unterschiedlichen Experimenten.',
      'Es ist gut Experimente mehrmals durchzuführen, um sicherzustellen, dass die Ergebnisse stimmen.',
      'Manchmal ändern Wissenschaftler*innen ihre Meinung über das, was in den Naturwissenschaften wahr ist.',
      'Erkenntnisse in naturwissenschaftlichen Fachbüchern ändern sich manchmal.'
))) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray")
Variable Text
EpistConv1 Eine gute Möglichkeit herauszufinden, ob etwas wahr ist, ist ein Experiment durchzuführen.
EpistConv2 Naturwissenschaftliche Erkenntnisse ändern sich manchmal.
EpistConv3 Gute Antworten basieren auf Befunden aus vielen unterschiedlichen Experimenten.
EpistConv4 Es ist gut Experimente mehrmals durchzuführen, um sicherzustellen, dass die Ergebnisse stimmen.
EpistConv5 Manchmal ändern Wissenschaftler*innen ihre Meinung über das, was in den Naturwissenschaften wahr ist.
EpistConv6 Erkenntnisse in naturwissenschaftlichen Fachbüchern ändern sich manchmal.
#Häufigkeitstabelle
kable(caption ='',
      col.names = c(
        'Variable',
        '#1','#2','#3','#4','#5','#6','#7',
        'sum',
        'sumNA',
        'N',
        'Median',
        'Mittelwert',
        'Itemschwierigkeit',
        'Standardabweichung',
        'r_cor',
        'r_drop'
        ),
      
  cbind(
    rbind(
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],EpistConv1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],EpistConv2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],EpistConv4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],EpistConv5),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',],EpistConv6),
    v_pre,
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],EpistConv1),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],EpistConv2),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],EpistConv4),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],EpistConv5),
catfreq(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',],EpistConv6),
    v_post
    ),
    c(round(alpha_pre$item.stats$r.cor ,digits=2),paste('raw \u03B1',round(alpha_pre$total$raw_alpha,digits=2)),round(alpha_post$item.stats$r.cor ,digits=2), paste('raw \u03B1',round(alpha_post$total$raw_alpha, digits=2))),
    c(round(alpha_pre$item.stats$r.drop,digits=2),'',round(alpha_post$item.stats$r.drop,digits=2),'')
  )
) %>%
  kable_styling(full_width = FALSE) %>%
  row_spec(0, background = "gray") %>% # Überschrift
  row_spec(1:6, background = "#dee393") %>% # Pre
  row_spec(c(6,12), bold = TRUE) %>% #fett
  row_spec(7:12, background = "#92b4c3") %>% # Post
  footnote(general = paste0('EpistConv3 wurde aufgrund negativer Korrelation entfernt.'), general_title = "Anmerkung:")
Variable #1 #2 #3 #4 #5 #6 #7 sum sumNA N Median Mittelwert Itemschwierigkeit Standardabweichung r_cor r_drop
EpistConv1 0 0 1 4 8 13 19 45 0 45 6 6 0.86 1.09 0.58 0.52
EpistConv2 0 0 0 3 10 10 22 45 0 45 6 6.13 0.88 0.99 0.78 0.69
EpistConv4 0 0 0 1 4 11 29 45 0 45 7 6.51 0.93 0.76 0.5 0.44
EpistConv5 0 1 3 2 11 12 16 45 0 45 6 5.73 0.82 1.3 0.62 0.57
EpistConv6 0 0 1 1 9 11 23 45 0 45 7 6.2 0.89 0.99 0.82 0.72
EpistConv (Skala) 45 6.12 0.87 0.71 raw α 0.8
EpistConv1 0 0 0 5 18 7 15 45 0 45 5 5.71 0.82 1.06 0.67 0.61
EpistConv2 0 1 0 2 7 9 26 45 0 45 7 6.24 0.89 1.11 0.82 0.76
EpistConv4 0 0 0 1 1 7 36 45 0 45 7 6.73 0.96 0.62 0.68 0.6
EpistConv5 0 1 1 5 8 7 22 44 1 45 6.5 5.93 0.85 1.32 0.67 0.61
EpistConv6 0 0 0 5 7 7 26 45 0 45 7 6.2 0.89 1.08 0.76 0.69
EpistConv (Skala) 45 6.17 0.88 0.79 raw α 0.84
Anmerkung:
EpistConv3 wurde aufgrund negativer Korrelation entfernt.
# Aufräumen
rm(v_pre,v_post)

# Plots erstellen
p <- create_bar_plot(data_subset_cca, 'EpistConv1', 30)
ggsave("bilder/EpistConv1cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'EpistConv2', 30)
ggsave("bilder/EpistConv2cca.png", plot = p, width = 10, height = 6, units = "cm")

#p <- create_bar_plot(data_subset_cca, 'EpistConv3', 30)
#ggsave("bilder/EpistConv3cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'EpistConv4', 50)
ggsave("bilder/EpistConv4cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'EpistConv5', 30)
ggsave("bilder/EpistConv5cca.png", plot = p, width = 10, height = 6, units = "cm")

p <- create_bar_plot(data_subset_cca, 'EpistConv6', 30)
ggsave("bilder/EpistConv6cca.png", plot = p, width = 10, height = 6, units = "cm")

# Boxplot erstellen
p <- create_box_plot(data_subset_cca, "EpistConv", "")
ggsave("bilder/EpistConvcca.png", plot = p, width = 10, height = 6, units = "cm")

# Kernel-Dichte-Schätzung erstellen
p <- create_density_plot(data_subset_cca,'EpistConv')
ggsave("bilder/EpistConvcca_den.png", plot = p, width = 10, height = 6, units = "cm")




Normalitätstest

Q-Q-Plots

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',], aes(sample=zGenVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="GenVal, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_GenValt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',], aes(sample=zGenVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="GenVal, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_GenValt1.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',], aes(sample=zPersVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="PersVal, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_PersValt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',], aes(sample=zPersVal)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="PersVal, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_PersValt1.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre',], aes(sample=zEpistConv)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="EpistConv, Zeitpunkt t[0]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_EpistConvt0.png", plot = p, width = 10, height = 6, units = "cm")

p <- ggplot(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post',], aes(sample=zEpistConv)) + coord_cartesian(ylim = c(-3, 3)) +
  stat_qq() + stat_qq_line() + labs(title="EpistConv, Zeitpunkt t[1]", x = "theoretische Quantile", y="beobachtete Quantile")
ggsave("bilder/QQ_cca_EpistConvt1.png", plot = p, width = 10, height = 6, units = "cm")




Shapiro-Wilk-Tests

GenVal

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre','GenVal'])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Pre", "GenVal"]
## W = 0.94533, p-value = 0.03389

p < 0.05: Nullhypothese der Normalverteilung wird abgelehnt.

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post', "GenVal"])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Post", "GenVal"]
## W = 0.93145, p-value = 0.01055

p < 0.05: Nullhypothese der Normalverteilung wird abgelehnt.

PersVal

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre','PersVal'])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Pre", "PersVal"]
## W = 0.98173, p-value = 0.6901

p > 0.05: Nullhypothese der Normalverteilung wird angenommen.

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post','PersVal'])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Post", "PersVal"]
## W = 0.96582, p-value = 0.2029

p > 0.05: Nullhypothese der Normalverteilung wird angenommen.

EpistConv

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Pre','EpistConv'])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Pre", "EpistConv"]
## W = 0.93375, p-value = 0.01275

p < 0.05: Nullhypothese der Normalverteilung wird abgelehnt.

shapiro.test(data_subset_cca[data_subset_cca$Zeitpunkt == 'Post','EpistConv'])
## 
##  Shapiro-Wilk normality test
## 
## data:  data_subset_cca[data_subset_cca$Zeitpunkt == "Post", "EpistConv"]
## W = 0.8893, p-value = 0.0004474

p < 0.05: Nullhypothese der Normalverteilung wird abgelehnt.


Wie geht’s weiter?

Aussagekräftig ist eigentlich nur die Complete Case Analysis. Zwei der drei Variablen zeigen keine Normalverteilung. Wie geht es weiter?

Mit der Variable PersVal, bei der ich Normalverteilung festgestellt habe, kann ich einen abhängigen t-Test rechnen.