Commit 5b6f260b authored by Maike Kleemeyer's avatar Maike Kleemeyer
Browse files

Add R-markdown file, Add reliability analyses

parent 736133b5
......@@ -70,10 +70,11 @@ scale_A <- responses_coded %>%
inter_item_A <- scale_A %>%
correlate() %>%
select(-term) %>%
colMeans(na.rm = TRUE)
select(-term)
corr_table_A <- bind_rows(inter_item_A, colMeans(inter_item_A, na.rm = TRUE))
rownames(corr_table_A) <- c(items, "mean")
mean(inter_item_A)
scale_A <- scale_A %>%
mutate(mean_A = rowMeans(., na.rm = TRUE))
......@@ -87,7 +88,12 @@ item_total_A
mean(item_total_A$mean_A)
scale_A$mean_A <- NULL # delete the score column we made earlier
rely_A <- psych::alpha(scale_A, check.keys=FALSE)
rely_A <- psych::alpha(scale_A, use = "complete.obs", check.keys=TRUE)
output_A <- bind_cols(rely_A$item.stats$n, rely_A$item.stats$mean, rely_A$item.stats$sd, rely_A$item.stats$r.drop, rely_A$alpha.drop$raw_alpha)
colnames(output_A) <- c("total", "mean", "SD", "Corrected Item total r", "Alpha if item deleted")
psych::alpha(scale_A, check.keys=TRUE)$total$std.alpha
......@@ -96,7 +102,7 @@ scale_B1 <- responses_coded %>%
select(B02:B07)
scale_B2 <- responses_coded %>%
select(B09:B14)
select(B09:B13)
scale_C <- responses_coded %>%
select(C02:C04)
......@@ -129,7 +135,7 @@ scale_H_parentalleave_no <- responses_coded %>%
## OLD R CODE
setwd("~/Seafile/FragebogenMpg/Reanalysen_Feb2020")
file1 = read.csv("20200106_MPG Work Culture_Basic Data_likert.csv",header=TRUE,sep=";")
file1 = read.csv("~/Seafile/FragebogenMpg/Reanalysen_Feb2020/20200106_MPG Work Culture_Basic Data_likert.csv",header=TRUE,sep=";")
library(psych)
library(umx)
......
This diff is collapsed.
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