Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block aaroncharlton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View authenticity.r
filter <- dplyr::filter
select <- dplyr::select
qualtrics <- read.csv("PPAuthenticity2SPAPR15.csv", stringsAsFactors = FALSE) %>%
filter(grepl("^95", ID)) %>% # remove responses without student ID
rename(adskep_2 = adskep_10,
adskep_3 = adskep_11,
adskep_4 = adskep_12,
adskep_5 = adskep_13,
View qualtrics.r
# 1. You will need to do a one-time install of the dplyr package (code on next line).
# install.packages("dplyr")
# 2. make sure to name the student ID column "ID" in both files
# 3. files must have two header rows (qualtrics-style) and be in .csv format
# 4. update all three of the following variables and don't forget the quotes!
qualtrics_file <- "Authenticity2.csv"
demos_file <- "Spring 2015 Demos %28UPPER 3-8%29 (1).csv"
save_location <- "C:/Users/abc/Downloads"
### shouldn't need to modify below this line ####
View gist:485bd28d54eb55f8a76f
<a href="">My friends' restaurant</a>
<i>Italic</i> versus <strong>Bold</strong>
<h1>Header 1</h1>
<h2>Header 2</h2>
<p>Regular paragraph</p>
View gist:ddb6edcfbdd1445de598
<a href="">Aaron's twitter page</a>
View Independence tests
type.1 <- NULL
p.values <- NULL
all.p <- NULL
for (j in 1:100){
for (i in 1:1000){
indy <- sample(1:2,29, replace=TRUE)
inter <- sample(1:2,31, replace=TRUE)
indy.c <- count(indy)[,2]
inter.c <- count(inter)[,2]
View gist:2a58914de3471052f798
## model selection
# This is Max Kuhn's tutorial on caret:
str(Sonar[, 1:10])
View gist:6e3e76907875f4e2e43e
# here is the data:
# You'll need to remove the first two lines and save a .csv file
markets <- read.csv("farmers-market.csv") <- markets %>%
View gist:b1ce016b7ea320423e93
# Study 1A
# find numbers for chi square table
indy_affect <- round(.552*29)
inter_affect <- round(.29*31)
inter_cog <- round(.71*31)
View gist:ef72963abe904bbed5d4
pf(q=6.21, df1=1, df2=132, lower.tail=FALSE) # interaction self-construal and mood
pf(q=4, df1=1, df2=132, lower.tail=FALSE)
pf(q=2.33, df1=1, df2=132, lower.tail=FALSE)
View gist:72bc1b5a52b483a5eaab
# chi-squared test
chisq.test(tbl) # Yate's continuity correction is the default
chisq.test(tbl, correct=FALSE) # no Yate's continuity correction
fisher.test(tbl) # fisher's exact test for count data
chisq.test(tbl, simulate.p.value=T, B=999) # Markov chain
You can’t perform that action at this time.