ben-domingue / irw

Code related to data for the Item Response Warehouse
https://datapages.github.io/irw/
7 stars 12 forks source link

mind-wandering scale #666

Closed ben-domingue closed 1 week ago

ben-domingue commented 3 weeks ago

https://link.springer.com/article/10.3758/s13428-024-02500-6#data-availability

(Edited by Arthur) Data available at: https://osf.io/mxn3v/

KingArthur0205 commented 1 week ago

Brief Mind Wandering Three-Factor Scale(BMW3_df) : a 12-item questionnaire available in German and English. Based on results from 1038 participants (823 German speakers, 215 English speakers). Five-point Likert response scale is used, with categories being labeled 0 = fully disagree, 1 = somewhat disagree, 2 = neutral, 3 = somewhat agree, and 4 = fully agree.

Mindful Attention Awareness Scale(MAAS_df ):15 items to measure dispositional mindfulness, based on results from 175 German speakers, 215 English speakers,ranging from 1 to 6.

International Personality Item Pool(IPIP_df) short 50-item version of the IPIP questionnaire, based on results from 176 German speakers, 215 English speakers, ranging from 1 to 5.

Deliberate Mind Wandering(DMW_df): 4 items, 215 English speakers, 176 German speakers, ranging from 1 to 7.

Spontaneous Mind Wandering(SMW_df ):4 items, 215 English speakers, 176 German speakers, ranging from 1 to 7.

Attentional Control Scale(ACS_df): the German version of the ACS as a 20-item measure of self-reported attentional control, 230 participants, ranging from 1 to 4.

Cognitive Emotion-Regulation Questionnaire(CERQ_df): The German versions of the 10-item Emotion Regulation Questionnaire and of the four-item rumination scale of the Cognitive Emotion-Regulation Questionnaire, 174 German Participants, ranging from 1 to 7.

KingArthur0205 commented 1 week ago

Data: OS_TBMWTFS_Schubert_2023.zip

Code:

# Paper: https://pmc.ncbi.nlm.nih.gov/articles/PMC5372834/#sec6
# Data: https://osf.io/fecgz/

library(haven)
library(dplyr)
library(tidyr)
library(openxlsx)
library(readr)
library(readxl)
library(sas7bdat)

rm(list =ls()) 
remove_na <- function(df) {
  df <- df[!(rowSums(is.na(df[, -which(names(df) %in% c("id"))])) == (ncol(df) - 1)), ]
  return(df)
}

German_BMW3_merged_df <- read.table("cleanData_BMW3_merged.txt",sep = ",", header = TRUE) # if the file has a header
US_UNGG_Personality_df <- read.table("cleanData_UNCG_personality_merged.txt",sep = ",", header = TRUE) # if the file has a header

US_UNGG_Personality_df <-US_UNGG_Personality_df |>
  rename(ID= id)
US_UNGG_Personality_df <- US_UNGG_Personality_df |>
  mutate(id = row_number())

US_cog_abilities_merged_df <- read.table("cleanData_UNCG_personality_merged.txt",sep = ",", header = TRUE)

# ------ Process BMW3 Dataset ------
HD4_ACS_df <- read.table("cleanData_HD4_ACS.txt",sep = ",", header = TRUE)
HD4_ACS_df <- HD4_ACS_df|>
  rename(ID= id)
HD4_ACS_df <- HD4_ACS_df|>
  mutate(id = row_number())

HD4_df <- read.table("cleanData_HD4.txt",sep = ",", header = TRUE) 
cleanData_HD2_Emotion_df  <- read.table("cleanData_HD2_Emotion.txt",sep = ",", header = TRUE) 

cleanData_HD2_Emotion_df <- cleanData_HD2_Emotion_df|>
  rename(ID= id)
cleanData_HD2_Emotion_df <- cleanData_HD2_Emotion_df|>
  mutate(id = row_number())

measurement_invariance_df <- read.table("cleanData_measurement_invariance.txt",sep = ",", header = TRUE) 

measurement_invariance_df <- measurement_invariance_df|>
  rename(ID= id)
measurement_invariance_df <- measurement_invariance_df|>
  mutate(id = row_number())

cleanData_personality_merged_df<- read.table("cleanData_personality_merged.txt",sep = ",", header = TRUE) 

cleanData_personality_merged_df <- cleanData_personality_merged_df|>
  rename(ID= id)
cleanData_personality_merged_df <- cleanData_personality_merged_df|>
  mutate(id = row_number())

cleanData_UNCG_BMW3_df <- read.table("cleanData_UNCG_BMW3.txt",sep = ",", header = TRUE) 
cleanData_WMC_merged_df <- read.table("cleanData_WMC_merged.txt",sep = ",", header = TRUE) 

BMW3_df <- measurement_invariance_df |>
  select(starts_with("BMW3"), id)
BMW3_df <- remove_na(BMW3_df)
BMW3_df <- pivot_longer(BMW3_df, cols=-c(id), names_to="item", values_to="resp")

BMW3_df$group <- c(rep("German", 9876), rep("English", 12456 - 9876))

save(BMW3_df, file="OS_TBMWTFS_Schubert_2023_BMW3.Rdata")
write.csv(BMW3_df,"OS_TBMWTFS_Schubert_2023_BMW3.csv", row.names=FALSE)

# ------ Process IPIP Dataset ------
German_IPIP_df <- cleanData_personality_merged_df |>
  select(matches("^IPIP.*0"),- ends_with("z"),id)
German_IPIP_df <- remove_na(German_IPIP_df)
German_IPIP_df <- pivot_longer(German_IPIP_df, cols=-c(id), names_to="item", values_to="resp")

English_IPIP_df <-US_UNGG_Personality_df |>
  select(matches("^IPIP.*0"),- ends_with("z"),id)
English_IPIP_df <- remove_na(English_IPIP_df)
English_IPIP_df <- pivot_longer(English_IPIP_df, cols=-c(id), names_to="item", values_to="resp")

German_IPIP_df$group <- "German"
English_IPIP_df$group <- "English"

IPIP_df <- rbind(German_IPIP_df,English_IPIP_df)
save(IPIP_df, file="OS_TBMWTFS_Schubert_2023_IPIP.Rdata")
write.csv(IPIP_df,"OS_TBMWTFS_Schubert_2023_IPIP.csv", row.names=FALSE)

# ------ Process MAAS Dataset ------
German_MAAS_df <- cleanData_personality_merged_df |>
  select(matches("^MAAS"),- ends_with("z"),-MAAS_p1, -MAAS_p2, -MAAS_p3,-MAAS, id)
German_MAAS_df <- remove_na(German_MAAS_df)
German_MAAS_df <- pivot_longer(German_MAAS_df, cols=-c(id), names_to="item", values_to="resp")

English_MAAS_df <- US_UNGG_Personality_df |>
  select(matches("^MAAS"), -ends_with("z"), -MAAS_p1, -MAAS_p2, -MAAS_p3,-MAAS,id)
English_MAAS_df <- remove_na(English_MAAS_df)
English_MAAS_df <- pivot_longer(English_MAAS_df, cols=-c(id), names_to="item", values_to="resp")

German_MAAS_df$group <- "German"
English_MAAS_df$group <- "English"

MAAS_df <- rbind(German_MAAS_df,English_MAAS_df)
save(MAAS_df, file="OS_TBMWTFS_Schubert_2023_MAAS.Rdata")
write.csv(MAAS_df,"OS_TBMWTFS_Schubert_2023_MAAS.csv", row.names=FALSE)

# ------ Process DMW Dataset ------
German_DMW_df <- cleanData_personality_merged_df |>
  select(matches("^DMW.*0"),- ends_with("z"),id)
German_DMW_df <- remove_na(German_DMW_df)
German_DMW_df <- pivot_longer(German_DMW_df, cols=-c(id), names_to="item", values_to="resp")

English_DMW_df <- US_UNGG_Personality_df |>
  select(matches("^DMW.*0"), -ends_with("z"), id)
English_DMW_df <- remove_na(English_DMW_df)
English_DMW_df <- pivot_longer(English_DMW_df, cols=-c(id), names_to="item", values_to="resp")

German_DMW_df$group <- "German"
English_DMW_df$group <- "English"

DMW_df <- rbind(German_DMW_df,English_DMW_df)
save(DMW_df, file="OS_TBMWTFS_Schubert_2023_DMW.Rdata")
write.csv(DMW_df,"OS_TBMWTFS_Schubert_2023_DMW.csv", row.names=FALSE)

# ------ Process SMW Dataset ------
German_SMW_df <- cleanData_personality_merged_df |>
  select(matches("^SMW.*0"),- ends_with("z"),id)
German_SMW_df <- remove_na(German_SMW_df)
German_SMW_df <- pivot_longer(German_SMW_df, cols=-c(id), names_to="item", values_to="resp")

English_SMW_df <- US_UNGG_Personality_df |>
  select(matches("^SMW.*0"), -ends_with("z"), id)
English_SMW_df <- remove_na(English_SMW_df)
English_SMW_df <- pivot_longer(English_SMW_df, cols=-c(id), names_to="item", values_to="resp")

German_SMW_df$group <- "German"
English_SMW_df$group <- "English"

SMW_df <- rbind(German_SMW_df,English_SMW_df)
save(SMW_df, file="OS_TBMWTFS_Schubert_2023_SMW.Rdata")
write.csv(SMW_df,"OS_TBMWTFS_Schubert_2023_SMW.csv", row.names=FALSE)

# ------ Process ACS Dataset ------
German_ACS_df1 <- HD4_ACS_df |>
  select(starts_with("ACS"),- ends_with("R"),-ends_with("z"),-ACS_sum,-ACS_FOC,-ACS_SHIF,id)
German_ACS_df1 <- remove_na(German_ACS_df1)
German_ACS_df1 <- pivot_longer(German_ACS_df1, cols=-c(id), names_to="item", values_to="resp")

German_ACS_df2 <- HD4_ACS_df |>
  select(starts_with("ACS")&ends_with("R"), -ends_with("z"),-ACS_sum,-ACS_FOC,-ACS_SHIF,id)
German_ACS_df2 <- remove_na(German_ACS_df2)
German_ACS_df2 <- pivot_longer(German_ACS_df2, cols=-c(id), names_to="item", values_to="resp")

ACS_df <- rbind(German_ACS_df1,German_ACS_df2)

save(ACS_df, file="OS_TBMWTFS_Schubert_2023_ACS.Rdata")
write.csv(ACS_df,"OS_TBMWTFS_Schubert_2023_ACS.csv", row.names=FALSE)

# ------ Process CERQ Dataset ------
German_ERQ_df <- cleanData_HD2_Emotion_df |>
  select(starts_with("ERQ"),-ends_with("z"),id)
German_ERQ_df  <- remove_na(German_ERQ_df)
German_ERQ_df <- pivot_longer(German_ERQ_df, cols=-c(id), names_to="item", values_to="resp")

German_Rumination_df <- cleanData_HD2_Emotion_df |>
  select(starts_with("Rumination"),-ends_with("z"),-Rumination,id)
German_Rumination_df<- remove_na(German_Rumination_df)
German_Rumination_df <- pivot_longer(German_Rumination_df, cols=-c(id), names_to="item", values_to="resp")

CERQ_df <- rbind(German_ERQ_df,German_Rumination_df)

save(CERQ_df, file="OS_TBMWTFS_Schubert_2023_CERQ.Rdata")
write.csv(CERQ_df,"OS_TBMWTFS_Schubert_2023_CERQ.csv", row.names=FALSE)