Skip to content

Instantly share code, notes, and snippets.

💭
My status is high.

Shravan Vasishth vasishth

💭
My status is high.
Block or report user

Report or block vasishth

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 fake data simulation logistic mixed effects model regression
library(lme4)
## load data
hindi10<-read.table("datacode/hindi10a.txt",header=TRUE)
## skipping: 1 if word is skipped, 0 otherwise
skip<-ifelse(hindi10$TFT==0,1,0)
hindi10$skip<-skip
summary(hindi10$word_complex)
## make a sum contrast for illustration
@vasishth
vasishth / sesamplesize1multiplechoice.Rnw
Created Jan 17, 2016
An example question with a multiple choice question.
View sesamplesize1multiplechoice.Rnw
<<echo=FALSE, results=hide>>=
## DATA GENERATION
mean.val<-round(rnorm(1,mean=100,sd=10),digits=0)
sd.val<-round(abs(rnorm(1,mean=10,sd=10)),digits=0)
n<-round(abs(rnorm(1,mean=100,sd=10)),digits=0)+1
se1<-round(sd.val/sqrt(n),digits=3)
se2<-round(sd.val/sqrt(n^2),digits=3)
questions <- character(5)
@vasishth
vasishth / ExampleExamCode.R
Last active Dec 3, 2016
Example code for automatically generating R exercises and exams
View ExampleExamCode.R
## Load library:
library("exams")
## exam questions:
myexamlist<-list("pnorm1","sesamplesize1multiplechoice")
## output directory
## create new test dir if one does not exist:
files.list<-system("ls",intern=TRUE)
@vasishth
vasishth / pnorm1.Rnw
Last active Jan 17, 2016
Example automated exercise for statistics introduction course
View pnorm1.Rnw
<<echo=FALSE, results=hide>>=
## DATA GENERATION
mean.val<-round(rnorm(1,mean=100,sd=100),digits=0)
sd.val<-round(rnorm(1,mean=100,sd=10),digits=0)
upper<-round(rnorm(1,mean=100,sd=100)+50,digits=0)
lower<-round(rnorm(1,mean=100,sd=100)-100,digits=0)
sol<-pnorm(upper,mean=abs(mean.val),sd=abs(sd.val))-pnorm(lower,mean=abs(mean.val),sd=abs(sd.val))
sol<-round(sol,digits=3)
@vasishth
vasishth / solutiontest.tex
Created Jan 17, 2016
The solutions to the automated test.
View solutiontest.tex
\documentclass[10pt,a4paper]{article}
%% packages
\usepackage{a4wide,verbatim,Sweave,url}
%% new environments
\newenvironment{question}{\item \textbf{Problem}\newline}{}
\newenvironment{solution}{\textbf{Solution}\newline}{}
\newenvironment{answerlist}{\renewcommand{\labelenumi}{(\alph{enumi})}\begin{enumerate}}{\end{enumerate}}
@vasishth
vasishth / test.tex
Created Jan 17, 2016
Example exam template for automating exams and homework using the exam package.
View test.tex
\documentclass[10pt,a4paper]{article}
%% packages
\usepackage{a4wide,verbatim,Sweave,url}
%% new environments
\newenvironment{question}{\item}{}
\newenvironment{solution}{\comment}{\endcomment}
\newenvironment{answerlist}{\renewcommand{\labelenumi}{(\alph{enumi})}\begin{enumerate}}{\end{enumerate}}
@vasishth
vasishth / powerinflationindex
Last active Aug 27, 2015
Power inflation index
View powerinflationindex
## true effect size:
D<-seq(1,250,by=1)
## SE from a study:
se<-46
## sample size
n<-37
## typical SD:
stddev<-se*sqrt(n)
## rejection value (absolute) under null:
@vasishth
vasishth / typesm
Created Aug 27, 2015
Simulating Type S and Type M errors
View typesm
## probable effect size derived from past studies:
D<-15
## SE from the study of interest:
se<-46
stddev<-se*sqrt(37)
nsim<-10000
drep<-rep(NA,nsim)
for(i in 1:nsim){
drep[i]<-mean(rnorm(37,mean=D,sd=stddev))
}
View vincentgranville.txt
“He seems to have a solid stats background back in the day”
A lot of people claim a lot of things about themselves. I have met a lot of people who characterize themselves as “fluent in Japanese” (oddly, these are always Americans), where their actual on-the-ground fluency level is pretty laughable.
I couldn’t find any clear statements about what his educational background is. He says on his linkedin page: “Facultés universitaires ‘Notre-Dame de la Paix’ Ph.D., Statistics, Mathematics, Science, 1983 – 1993″, Then he lists two courses he did there, “Stochastic Geometry, Markov Processes.” I find it odd that a guy does a PhD somewhere, over 10 years, and lists two courses under that PhD.
Also, I searched for this mysterious uni I have never heard of: Facultés universitaires ‘Notre-Dame de la Paix.
I ended up at a weird Jesuits page in Belgium:
@vasishth
vasishth / ranking.Rnw
Created Nov 25, 2014
hospital rankings
View ranking.Rnw
<<>>=
# n: no of operations
# x: no of deaths
# N: no of hospitals
dat<-list(n=c(47,211,810,148,196,360,119,207,97,
256,148,215),
x=c(0,8,46,9,13,24,8,14,8,29,18,31),
N=12)
cat("model
You can’t perform that action at this time.