SHARE
TWEET

Untitled

a guest Feb 25th, 2020 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(tidyverse)
  2. library(Rmisc)
  3. library(psych)
  4. library(emmeans)
  5. library(afex)
  6.  
  7. experimentdata <- read_csv("Psy_120L Data_Firoz3.csv")
  8.  
  9. experimentdata$Prime <- case_when(experimentdata$Rich_prime_write == 0 ~ "Rich",
  10.                                   experimentdata$Poor_prime_write == 0 ~ "Poor")
  11.  
  12.  
  13.  
  14. #Descriptive Statistics (frequencies, means, etc.)
  15.  
  16. table(experimentdata$Gender) #16 Male, 46 Female
  17.  
  18. table(experimentdata$Gender)/length(experimentdata$Gender) #26% Male, 74% Female
  19.  
  20.  
  21. # 2x2 ANOVA on IV1 x Moderator on DV1
  22. a1 <- aov_ez(experimentdata,
  23.              id = "ID",
  24.              dv = "AttractionScore",
  25.              between = c("Gender", "Prime"))
  26.  
  27. a1
  28.  
  29. # 2x2 ANOVA on IV1 x Moderator on DV2
  30. a2 <- aov_ez(experimentdata,
  31.              id = "ID",
  32.              dv = "LikabilityScore",
  33.              between = c("Gender", "Prime"))
  34.  
  35. a2
  36.  
  37. # 2x2 ANOVA on IV2 x Moderator on DV1
  38. a3 <- aov_ez(experimentdata,
  39.              id = "ID",
  40.              dv = "AttractionScore",
  41.              between = c("Gender", "FaceCondition"))
  42.  
  43. a3
  44.  
  45. # 2x2 ANOVA on IV2 x Moderator on DV2
  46. a4 <- aov_ez(experimentdata,
  47.              id = "ID",
  48.              dv = "LikabilityScore",
  49.              between = c("Gender", "FaceCondition"))
  50.  
  51. a4
  52.  
  53. # 2x2 ANOVA on IV1 x IV2 on DV1
  54. a5 <- aov_ez(experimentdata,
  55.              id = "ID",
  56.              dv = "AttractionScore",
  57.              between = c("Prime", "FaceCondition"))
  58.  
  59. a5
  60.  
  61. # 2x2 ANOVA on IV1 x IV 2 on DV2
  62. a6 <- aov_ez(experimentdata,
  63.              id = "ID",
  64.              dv = "LikabilityScore",
  65.              between = c("Prime", "FaceCondition"))
  66.  
  67. a6
  68.  
  69. #Bar Plot
  70. newdataset <- experimentdata %>%
  71.   dplyr::group_by(Prime, FaceCondition) %>%
  72.   dplyr::summarize(mean_attraction = CI(AttractionScore) ["mean"],
  73.                    sem_attr = sd(AttractionScore)/sqrt(length(AttractionScore)-1))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top