ben-domingue / irw

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

Validation of the child's implicit self-esteem measure – Polish version of the Preschool Implicit Attitudes Test #460

Closed ben-domingue closed 1 month ago

ben-domingue commented 1 month ago

https://osf.io/k2qew/

License: CC-By Attribution 4.0 International

KingArthur0205 commented 1 month ago

Data: VCISM_Polish_Trzcińska_2023.csv

Code:

# Paper:
# Data: https://osf.io/k2qew/
library(haven)
library(dplyr)
library(tidyr)

# Remove participants whose responses are all NAs
remove_na <- function(df) {
  df <- df[!(rowSums(is.na(df[, -which(names(df) == "id")])) == (ncol(df) - 1)), ]
  return(df)
}

df <- read_sav("psiat_validation.sav")
df <- df |>
  select(child_code, starts_with("pspcsa"), -PSPCSA, 
         -PSPCSA_competences, -PSPCSA_acceptance) |>
  rename(id=child_code)  
df <- remove_na(df)

# ------ Process Test Dataset ------
test_df <- df |>
  select(-ends_with("r"))
test_df[] <- lapply(test_df, function(col) { # Remove column labels for each column
  attr(col, "label") <- NULL
  return(col)
})
test_df <- pivot_longer(test_df, cols=-id, names_to = "item", values_to = "resp")
test_df$wave <- 0

# ------ Process Re-test Dataset ------
retest_df <- df |>
  select(id, ends_with("r"))
colnames(retest_df) <- gsub('r', '', colnames(retest_df))
retest_df[] <- lapply(retest_df, function(col) { # Remove column labels for each column
  attr(col, "label") <- NULL
  return(col)
})
retest_df <- pivot_longer(retest_df, cols=-id, names_to = "item", values_to = "resp")
retest_df$wave <- 1

df <- rbind(test_df, retest_df)
save(df, file="VCISM_Polish_Trzcińska_2023.Rdata")
write.csv(df, "VCISM_Polish_Trzcińska_2023.csv", row.names=FALSE)
KingArthur0205 commented 1 month ago

This paper includes 1 dataset, with data from 120 participants. However, 5 participants provided all NA responses and thus have been excluded in the processed dataset.

The participants first responded to 12 items on a 4-point scale. Later, they took a re-test on 6 of the 12 items(6, 13, 14, 16, 17, 22). This has been indicated by the wave column

KingArthur0205 commented 1 month ago

PR for this issue: https://github.com/ben-domingue/irw/pull/465