Last active
April 24, 2016 23:15
-
-
Save Deleetdk/ca13a70eb577a742a50c4f31a0f4ed14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(pacman) | |
p_load(haven, dplyr, kirkegaard) | |
# load data --------------------------------------------------------------- | |
entiredata = read.csv("Woodcock-Johnson Murray_2007.csv") | |
# subset ------------------------------------------------------------------ | |
#only first two races, and two other conditions | |
d = subset(entiredata, racesample < 3 & wj == 1 & sample == 1) | |
#cognitive ability vars | |
v_cogvars = c("c01picvocab", "c03memsen", "c04visaudit", "c05blend", "c07vismatch", "c08antsyn", "c09analsyn", "c10numrev", "c11concform") | |
# plots ------------------------------------------------------------------- | |
#plot the distribution of the data and test for normality with shapiro test | |
sapply(v_cogvars, FUN = function(var) { | |
#plot n save | |
GG_denhist(d, var = var) | |
ggsave(var + ".png") | |
#test for normality | |
shapiro.test(d[[var]]) | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment