Skip to content

Instantly share code, notes, and snippets.

View mickeypash's full-sized avatar
🐢
slow and steady wins the race

Mickey Pashov mickeypash

🐢
slow and steady wins the race
View GitHub Profile
@mickeypash
mickeypash / Problem 2
Created October 18, 2012 08:51
How to do the data frame
x <- data.frame(SubjID=1:20
Student=factor(rep(c("Freshmen","Sophomores"
"Junior","Seniors"),each=5)),
Y=c(32,30,28,30,25,27,27,30,30,21,27,22,23,23,25,22,20,22,23,13))
@mickeypash
mickeypash / .gitignore
Created February 24, 2014 05:28
Git ignore file for when I start doing python development
# OS generated files
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
@mickeypash
mickeypash / preprocess.R
Created February 24, 2014 06:27
preprocessing script for raw data from Lex app
library(XML)
atime <- read.csv("audiotimings.csv")
atime$ItemID <- as.numeric(substr(atime$Wavfile, 2, 3))
options(stringsAsFactors=FALSE)
getfile <- function(x, ext=NULL) {
return(paste(paste(mypath, x$base, sep="/"), ext, "txt", sep="."))
}
@mickeypash
mickeypash / zeltek.R
Created February 24, 2014 06:51
This is what I came up with. Not sure if this works for you.
clippedaod <- data.frame(yr=c(2000,2001,2002,2003,2004,2005))
tst <- c()
for(i in 2000:2013){
tst[i] <- (clippedaod$yr == i)
print(i)
}
@mickeypash
mickeypash / plot.R
Created February 28, 2014 16:49
can anyone tell me how to imporve this plot
load(file="preprocessed.RData")
load(file="alldat.RData")
colnames(alldat) <- sub("\\.x$", "", colnames(alldat))
rownames(alldat) <- NULL
mx <- as.matrix(xtabs(~AOI+Msec, alldat))
props <- mx / apply(mx, 2, sum)
# Use ggplot to make it cool?
@mickeypash
mickeypash / mickey_tea_tasting
Created March 4, 2014 23:11
One-sample T -tests of proportion of fixations for PComp and Unrl at 800ms bins?
## T-test
library(plyr)
load(file="preprocessed.RData")
# Read data
trials <- tinfo4
responses <- dat4
# Change column names
@mickeypash
mickeypash / Shapiro-test
Created March 7, 2014 15:46
Playing with normality
> shapiro.test(prop.mean$PComp)
Shapiro-Wilk normality test
data: prop.mean$PComp
W = 0.9662, p-value = 0.528
> shapiro.test(prop.mean$SComp)
Shapiro-Wilk normality test
############ Shapiro test #################
########### normality #####################
> shapiro.test(prop.mean$PComp)
Shapiro-Wilk normality test
data: prop.mean$PComp
W = 0.9662, p-value = 0.528
@mickeypash
mickeypash / Barplots
Created March 9, 2014 18:43
I need to add errobars to this plot and maybe make a transformation or use something other than barplots to visualise these means
b.means <-c (0.2356355, 0.2294562, 0.2197686)
barplot(b.means,ylim=c(0,1), main="Mean proportion for competitors",
names.arg= c("Phonological", "Semantic", "Distractor"), col = c("gray1", "gray45", "gray90"))
@mickeypash
mickeypash / I am dying
Created March 9, 2014 19:00
ggplot is so difficult for me
library(ggplot2)
gg.means <- data.frame(PComp=mean(prop.mean$PComp), SComp=mean(prop.mean$SComp), Unrl=mean(prop.mean$Unrl))
ggplot(melt(gg.means,id.var=c()), aes(x=,y=Value)) + geom_bar()