Commit 14ee8536 authored by Maike Kleemeyer's avatar Maike Kleemeyer
Browse files

Add analyses chunks

parent 5b6f260b
--- ---
title: "MPGQuestionnaireReport" title: "MPGQuestionnaireReport"
author: "Kleemeyer" author: "Kleemeyer"
date: "11/4/2020" date: "`r format(Sys.time(), '%d %B, %Y')`"
output: output:
pdf_document: default # pdf_document: default
html_document: default html_document: default
--- ---
```{r setup, include=FALSE} ```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE) knitr::opts_chunk$set(echo = TRUE, message = FALSE)
library(knitr) library(knitr)
library(kableExtra)
library(ggplot2) library(ggplot2)
library(dplyr) library(dplyr)
library(corrr) library(corrr)
library(umx)
library(matrixStats)
source("get_data_exported.R") source("get_data_exported.R")
``` ```
# Scale consistency # Scale consistency
* SCALE A: Group atmosphere ## SCALE A: Group atmosphere
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_A <- responses_coded %>% interitem_A <- responses_coded %>%
select(A03:A05) %>% select(A03:A05) %>%
correlate() correlate()
...@@ -44,9 +47,9 @@ kable(output_A, caption = "Item statistics scale A") ...@@ -44,9 +47,9 @@ kable(output_A, caption = "Item statistics scale A")
Cronbach's alpha for Scale A is `r rely_A$total$std.alpha`. Cronbach's alpha for Scale A is `r rely_A$total$std.alpha`.
* SCALE B1: Leadership leadstyle ## SCALE B1: Leadership leadstyle
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_B1 <- responses_coded %>% interitem_B1 <- responses_coded %>%
select(B02:B07) %>% select(B02:B07) %>%
correlate() correlate()
...@@ -70,9 +73,9 @@ kable(output_B1, caption = "Item statistics scale B1") ...@@ -70,9 +73,9 @@ kable(output_B1, caption = "Item statistics scale B1")
Cronbach's alpha for Scale B1 is `r rely_B1$total$std.alpha`. Cronbach's alpha for Scale B1 is `r rely_B1$total$std.alpha`.
* SCALE B2: Leadership development ## SCALE B2: Leadership development
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_B2 <- responses_coded %>% interitem_B2 <- responses_coded %>%
select(B09:B13) %>% select(B09:B13) %>%
correlate() correlate()
...@@ -96,9 +99,9 @@ kable(output_B2, caption = "Item statistics scale B2") ...@@ -96,9 +99,9 @@ kable(output_B2, caption = "Item statistics scale B2")
Cronbach's alpha for Scale B2 is `r rely_B2$total$std.alpha`. Cronbach's alpha for Scale B2 is `r rely_B2$total$std.alpha`.
* SCALE C: Commitment ## SCALE C: Commitment
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_C <- responses_coded %>% interitem_C <- responses_coded %>%
select(C02:C04) %>% select(C02:C04) %>%
correlate() correlate()
...@@ -122,9 +125,9 @@ kable(output_C, caption = "Item statistics scale C") ...@@ -122,9 +125,9 @@ kable(output_C, caption = "Item statistics scale C")
Cronbach's alpha for Scale C is `r rely_C$total$std.alpha`. Cronbach's alpha for Scale C is `r rely_C$total$std.alpha`.
* SCALE D: Bullying ## SCALE D: Bullying
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_D <- responses_coded %>% interitem_D <- responses_coded %>%
select(D02:D06) %>% select(D02:D06) %>%
correlate() correlate()
...@@ -148,9 +151,9 @@ kable(output_D, caption = "Item statistics scale D") ...@@ -148,9 +151,9 @@ kable(output_D, caption = "Item statistics scale D")
Cronbach's alpha for Scale D is `r rely_D$total$std.alpha`. Cronbach's alpha for Scale D is `r rely_D$total$std.alpha`.
* SCALE E: Gender discrimination ## SCALE E: Gender discrimination
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_E <- responses_coded %>% interitem_E <- responses_coded %>%
select(E03:E05) %>% select(E03:E05) %>%
correlate() correlate()
...@@ -174,9 +177,9 @@ kable(output_E, caption = "Item statistics scale E") ...@@ -174,9 +177,9 @@ kable(output_E, caption = "Item statistics scale E")
Cronbach's alpha for Scale E is `r rely_E$total$std.alpha`. Cronbach's alpha for Scale E is `r rely_E$total$std.alpha`.
* SCALE F: Sexual harassment ## SCALE F: Sexual harassment
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_F <- responses_coded %>% interitem_F <- responses_coded %>%
select(F02:F08) %>% select(F02:F08) %>%
correlate() correlate()
...@@ -200,9 +203,9 @@ kable(output_F, caption = "Item statistics scale F") ...@@ -200,9 +203,9 @@ kable(output_F, caption = "Item statistics scale F")
Cronbach's alpha for Scale F is `r rely_F$total$std.alpha`. Cronbach's alpha for Scale F is `r rely_F$total$std.alpha`.
* SCALE H1: Work-life Balance ## SCALE H1: Work-life Balance
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_H1 <- responses_coded %>% interitem_H1 <- responses_coded %>%
select(H02:H06) %>% select(H02:H06) %>%
correlate() correlate()
...@@ -226,9 +229,9 @@ kable(output_H1, caption = "Item statistics scale H1") ...@@ -226,9 +229,9 @@ kable(output_H1, caption = "Item statistics scale H1")
Cronbach's alpha for Scale H1 is `r rely_H1$total$std.alpha`. Cronbach's alpha for Scale H1 is `r rely_H1$total$std.alpha`.
* SCALE H2: Work-family Balance ## SCALE H2: Work-family Balance
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_H2 <- responses_coded %>% interitem_H2 <- responses_coded %>%
select(H09:H13) %>% select(H09:H13) %>%
correlate() correlate()
...@@ -252,9 +255,9 @@ kable(output_H2, caption = "Item statistics scale H2") ...@@ -252,9 +255,9 @@ kable(output_H2, caption = "Item statistics scale H2")
Cronbach's alpha for Scale H2 is `r rely_H2$total$std.alpha`. Cronbach's alpha for Scale H2 is `r rely_H2$total$std.alpha`.
* SCALE H3: Parental leave - yes ## SCALE H3: Parental leave - yes
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_H3 <- responses_coded %>% interitem_H3 <- responses_coded %>%
select(H17:H21) %>% select(H17:H21) %>%
correlate() correlate()
...@@ -278,9 +281,9 @@ kable(output_H3, caption = "Item statistics scale H3") ...@@ -278,9 +281,9 @@ kable(output_H3, caption = "Item statistics scale H3")
Cronbach's alpha for Scale H3 is `r rely_H3$total$std.alpha`. Cronbach's alpha for Scale H3 is `r rely_H3$total$std.alpha`.
* SCALE H4: Parental leave - no ## SCALE H4: Parental leave - no
```{r echo = FALSE, message = FALSE} ```{r echo = FALSE, results='asis'}
interitem_H4 <- responses_coded %>% interitem_H4 <- responses_coded %>%
select(H23:H25) %>% select(H23:H25) %>%
correlate() correlate()
...@@ -304,61 +307,92 @@ kable(output_H4, caption = "Item statistics scale H4") ...@@ -304,61 +307,92 @@ kable(output_H4, caption = "Item statistics scale H4")
Cronbach's alpha for Scale H4 is `r rely_H4$total$std.alpha`. Cronbach's alpha for Scale H4 is `r rely_H4$total$std.alpha`.
# Analyses # Factor Analyses
```{r echo = FALSE, message = FALSE, include = FALSE}
likert <- responses_coded %>%
select(A03:B13,C02:D06,E03:E05,F02:F08,H02:H06)
efa <- umxEFA(likert, factors = 8, minManifests = 5)
factors <- as.data.frame(loadings(efa))
color.me <- rowMaxs(abs(loadings(efa)))
```
```{r echo = FALSE, message = FALSE}
factors %>%
mutate(items = row.names(.)) %>%
relocate(items) %>%
mutate_all(~cell_spec(
.x,
color = ifelse(abs(.x) %in% color.me, "red", "black"))) %>%
kbl(format = "html", escape = F) %>%
kable_paper("striped") %>%
pack_rows("Scale A", 1, 3) %>%
pack_rows("Scale B", 4, 14) %>%
pack_rows("Scale C", 15, 17) %>%
pack_rows("Scale D", 18, 22) %>%
pack_rows("Scale E", 23, 25) %>%
pack_rows("Scale F", 26, 32) %>%
pack_rows("Scale H", 33, 37) %>%
kable_styling()
```
# General Analyses
In total, `r nrow(responses)` participants (partly) completed the questionnaire. In total, `r nrow(responses)` participants (partly) completed the questionnaire.
# Binary Questions # Binary Questions
* Do you work in a group? * Do you work in a group?
```{r echo = FALSE, results='asis'}
```{r echo = FALSE} kable(table(responses$A01, useNA = "ifany"))
table(responses$A01, useNA = "ifany")
``` ```
* Did you have a personal conversation with your supervisor? * Did you have a personal conversation with your supervisor?
```{r echo = FALSE, results='asis'}
```{r echo = FALSE} kable(table(responses$B14, useNA = "ifany"))
table(responses$B14, useNA = "ifany")
``` ```
* Have you been subjected to bullying during the past 12 months? * Have you been subjected to bullying during the past 12 months?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$D12, useNA = "ifany") kable(table(responses$D12, useNA = "ifany"))
``` ```
* Have you been subjected to gender discrimination during the past 12 months? * Have you been subjected to gender discrimination during the past 12 months?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$E05, useNA = "ifany") kable(table(responses$E05, useNA = "ifany"))
``` ```
* Have you been subjected to sexual harassment during the past 12 months? * Have you been subjected to sexual harassment during the past 12 months?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$F11, useNA = "ifany") kable(table(responses$F11, useNA = "ifany"))
``` ```
* Do children under the age of 18 live in your household? * Do children under the age of 18 live in your household?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$H07, useNA = "ifany") kable(table(responses$H07, useNA = "ifany"))
``` ```
* Do people with care needs live in your household? * Do people with care needs live in your household?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$H30, useNA = "ifany") kable(table(responses$H30, useNA = "ifany"))
``` ```
* Have you taken parental leave? * Have you taken parental leave?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$H14, useNA = "ifany") kable(table(responses$H14, useNA = "ifany"))
``` ```
* Ehat is your gender? * What is your gender?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$I02, useNA = "ifany") kable(table(responses$I02, useNA = "ifany"))
``` ```
* What is your position in the MPG? * What is your position in the MPG?
```{r echo = FALSE} ```{r echo = FALSE, results='asis'}
table(responses$I03, useNA = "ifany") kable(table(responses$I03, useNA = "ifany"))
``` ```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment