python ghclone.py
Follow the prompts
Notes
library(MASS) | |
## let's assume that | |
## X ~ N(1.0, 1.5) | |
## Y ~ N(2.0, 2.1) | |
## Z ~ N(0.5, 1.0) | |
## r_XY = 0.2, r_XZ = 0.4, r_YZ = -0.3 | |
## create a vector of standard diviations | |
std <- c(1.5, 2.1, 1.0) |
In R | |
dfr <- read.table(file="c:/tmp/dataset.csv", sep=",", header=TRUE) | |
head(dfr) | |
length(table(dfr$ipnum)) | |
lmer(ene ~ videocond + ifrelevant + videorelevant + choicenum +(1|ipnum), data=dfr) | |
> lmer(ene ~ videocond + ifrelevant + videorelevant + choicenum +(1|ipnum), data=dfr) | |
Linear mixed model fit by REML | |
Formula: ene ~ videocond + ifrelevant + videorelevant + choicenum + (1 | ipnum) |
## Note: No missing values in tvc.start_/tvc.stop_ allowed! | |
## 0. Step: Make up some data | |
## event: event status | |
## start: starting time | |
## stop: ending time | |
## tvc.start_: starting time of qualitative/categorial TVC | |
## tvc.stop_: ending time of qualitative/categorial TVC | |
df <- data.frame(id=c(1, 2), |
## | |
## See "Counting with by" for a Stata example | |
## http://www.ats.ucla.edu/stat/stata/notes/countn.htm | |
## Hadley's version (which I like most) using ave() and seq_along() | |
mydf <- data.frame(id = c(1,1,1,2,2,2,2,3,3,3), v1 = 1) | |
mydf | |
mydf$v2 <- ave(mydf$v1, mydf$id, FUN = seq_along) | |
mydf | |
a <- data.frame(id = c(1,2,3,7,9), y1 = rnorm(5)) | |
b <- data.frame(id = 1:3, y2 = rnorm(3)) | |
c <- data.frame(id = 1:4, y3 = rnorm(4)) | |
a | |
b | |
c | |
Reduce(function(x,y){merge(x, y, by.x = "id", by.y = "id", all = TRUE)}, | |
list(a, b, c), accumulate = FALSE) |
doInstall <- TRUE | |
toInstall <- c("Hmisc", "ggplot2", "proxy", "grid") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
# Example usage | |
x <- c(4,6,4,5,6,7) | |
y <- 1:6 | |
plot(x, y, "o", pch=20) # bezier() generates smoothed curves from these points | |
points(bezier(x, y), type="l", col="red") |
RMDFILE=demo-rmd-pandoc | |
PANDOC=~/.cabal/bin/pandoc | |
all: | |
Rscript -e "require(knitr); require(markdown); knit('$(RMDFILE).rmd', '$(RMDFILE).md'); purl('$(RMDFILE).rmd')" | |
${PANDOC} --mathjax --toc -B header.html -A footer.html --bibliography refs.bib --css markdown.css -s $(RMDFILE).md -o $(RMDFILE).html | |
library(ggplot2) | |
library(lme4) | |
library(mvtnorm) | |
fixed.intercept <- 1 | |
n.subject <- 10 | |
n.replicate <- 10 | |
mean.subject <- c(1, 2, 3, 3, 2, 1) | |
sd.subject <- 0.1 * diag(length(mean.subject)) | |
sd.noise <- 0.5 |
\documentclass[]{article} | |
\usepackage{tikz} | |
\usetikzlibrary{positioning} | |
\begin{document} | |
%Graph 1 | |
\begin{figure} | |
\caption{Graph 1} | |
\large{\begin{tikzpicture}[% |