Skip to content

Instantly share code, notes, and snippets.

@rpietro
rpietro / Hospital_Doctor_Patient_Dataset.R
Last active August 29, 2015 14:14
Hospital Doctor Patient Dataset
# Introduction to SAS. UCLA: Statistical Consulting Group. from http://www.ats.ucla.edu/stat/sas/notes2/ (accessed November 24, 2007).
# install.packages('lme4', repos='http://cran.us.r-project.org')
# install.packages('corpcor', repos='http://cran.us.r-project.org')
require(lme4)
require(compiler)
require(MASS) # for multivariate normal function
require(corpcor) # to make a matrix positive definite
## Loading required package: corpcor
@rpietro
rpietro / IPython_notebook_shortcuts.md
Last active August 29, 2015 14:11
ipython notebook shortcuts

IPython notebook shortcuts

Command Mode (press Esc to enable)

Enter: edit mode
Shift-Enter: run cell, select below
Ctrl-Enter: run cell
Alt-Enter: run cell, insert below
y: to code

@rpietro
rpietro / orientdb_commands.md
Created December 14, 2014 01:49
orientdb commands

Orientdb available commands:

  • alter class Alter a class in the database schema
  • alter cluster Alters a cluster in the current database. The cluster can be physical or memory
  • alter database Alter a database property
  • alter property Alter a class property in the database schema
  • backup database Backup a database
  • begin Begins a transaction. All the changes will remain local
  • browse class Browse all records of a class
  • browse cluster Browse all records of a cluster
@rpietro
rpietro / bnlearn.R
Last active August 29, 2015 14:10
script for bnlearn examples
# http://www.bnlearn.com/examples/
# install.packages('bnlearn', repos='http://cran.us.r-project.org')
library(bnlearn)
e = empty.graph(LETTERS[1:6])
class(e)
e
empty.graph(LETTERS[1:6], num = 2)
@rpietro
rpietro / nonrandom.R
Last active August 29, 2015 14:09
propensity score script from "Propensity score based data analysis" by Susanne Stampf
## Propensity score based data analysis by Susanne Stampf - http://cran.r-project.org/web/packages/nonrandom/vignettes/nonrandom.pdf
#install.packages("nonrandom")
library("nonrandom")
## PS ESTIMATION
require(glm2)
data(pride)
@rpietro
rpietro / matrices.R
Last active August 29, 2015 14:08
code for Appendix: A Review of Matrices
# Script for Appendix E: A Review of Matrices @ http://www.personality-project.org/r/book/AppendixE.F.pdf
(v1 <- seq(1, 6))
(v2 <- seq(7, 12))
(v3 <- v1 + 20)
(v4 <- v1 + v2)
(v5 <- v1 * 3)
(v6 <- v1 * v2) # multiplies element by element, not a matrix multiplication
(v7 <- seq(1,4))
(V8 <- v1%*%t(v7)) #transpose to get the inner product
@rpietro
rpietro / brew_cask.sh
Last active November 11, 2015 20:19
brew cask installer
#!/bin/sh
brew cask install atext
brew cask install google-chrome
brew cask install skype
brew cask install vlc
brew cask install picasa
brew cask install dropbox
@rpietro
rpietro / mindspace_nof1.md
Last active August 29, 2015 14:08
MINDSPACE framework applied to n-of-1 trials

MINDSPACE framework applied to n-of-1 trials

  • email maçaneiro para todo o grupo dizendo que vai mandar material ao longo das próximas semanas
  • email personalizado (para cada residente especificamente) com incentivos
    • email semanal ranking pdf rosto - grafico progressão - imediata - email cartaz marisa
    • USP/Duke competition
    • modos diferentes de apresentação
      • video
      • storytelling - emotions catastrophic - Anderson (joelho), Gabriel (ombro), Gambetta (fratura)
  • graficos mão
@rpietro
rpietro / precog_ontology.md
Last active August 29, 2015 14:08
precog ontology

Precog ontology

Questions

  • protege vs editor vs topbraid??
  • visualização melhor do que ontograf?? has export function to .dot
  • design contendo R and ArticleSemanticRepresentation??
  • genid11 como member de DataScientist??
  • MetaAnalysis como member de Technology??
@rpietro
rpietro / edx_xml_structure.md
Last active August 29, 2015 14:08
XML structure for Open edX

The structure behind the XML for Open edX courses

Here are some loose facts in no particular order:

  1. Courses are imported and exported as tar.gz files
  2. A typical Open edX course has the following hierarchy 3. sections 4. subsections 5. units 6. videos, html files, exercises