Skip to content

Instantly share code, notes, and snippets.

View briatte's full-sized avatar

François Briatte briatte

View GitHub Profile
@briatte
briatte / README.md
Last active December 22, 2015 02:49
The Israel survey weights in the European Social Survey need fixing.
@briatte
briatte / grades.r
Created October 15, 2013 13:50
R script to check grades
## grade checks
setwd("...")
data = dir(pattern = ".txt")
data = lapply(data, function(x) {
g = as.numeric(substr(x, 1, 1))
l = readLines(x)
n = l[grepl("Note indicative", l)]
@briatte
briatte / hmisc.r
Created October 19, 2013 09:36
weighted quantile functions that actually do NOT return exactly the same output: reldist often returns the same thing for any value of its quantile argument
> Hmisc::wtd.quantile
function (x, weights = NULL, probs = c(0, 0.25, 0.5, 0.75, 1),
type = c("quantile", "(i-1)/(n-1)", "i/(n+1)", "i/n"), normwt = FALSE,
na.rm = TRUE)
{
if (!length(weights))
return(quantile(x, probs = probs, na.rm = na.rm))
type <- match.arg(type)
if (any(probs < 0 | probs > 1))
stop("Probabilities must be between 0 and 1 inclusive")
@briatte
briatte / ggnet.demo.md
Last active December 26, 2015 21:09
R Addicts 2013 ggnet demo code

See demo code below and companion slides for details.

The demo code will install the required packages and download one-mode example network data from the ggnet repository. For two-mode example network data, see the neta repository. Both represent ties between French Members of Parliament from recent legislatures. For more data, see NosDéputés.fr.

ggnet example plot

Challenges in Introductory Statistics

  • The future of statistics will depend even more than today on a wide audience of people whose primary area of knowledge is not statistics.
  • In many cases, "Introductory Statistics" means "Introduction to Data Management, Data Analysis and Computer Programming for Beginners".
  • Almost every second spent on the teaching of p-values might be more usefully spent teaching open access, replication and reproducibility.

Background assumptions:

  1. Quantification and visualization are main drivers for attention to statistical methods in areas like advocacy, social science and journalism, where most practitioners of statistics have no claim towards statistician status. Also, Hilary Mason's first point.
  2. For many students taking an "intro. to stats" course, the learning objectives cover a much larger spectrum of skills required for applied empirical research and its deriva
--- amendments13_jul2013.html
+++ amendments13_dec2013.html
@@ -224,6 +224,7 @@
<td class="searchformfont">N&deg; :</td>
<td>
<select name='NUM_INIT' onChange='submitSelect()' class="searchformfont"><option value='' >&nbsp;</option>
+<option value="9999">9999 (3 amdts)</option>
<option value="4429">4429 (7 amdts)</option>
<option value="4411">4411 (19 amdts)</option>
<option value="4405">4405 (1 amdts)</option>
@briatte
briatte / egocentric_plots.md
Last active January 1, 2016 20:29
egocentric cosponsorship networks in the French National Assembly
@briatte
briatte / layout_par.md
Last active January 1, 2016 23:59
controlling the seed.coord of Fruchterman-Reingold placement does not return identical graphs
@briatte
briatte / npm-debug.log
Created January 19, 2014 22:41
install error with https://npmjs.org/package/contextify on OS X 10.9
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.10.24/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'topojson' ]
2 info using npm@1.3.21
3 info using node@v0.10.24
4 verbose cache add [ 'topojson', null ]
5 verbose cache add name=undefined spec="topojson" args=["topojson",null]
@briatte
briatte / integritate_7_61.log
Last active January 4, 2016 12:49
integritate scraper log for subcategory 7_61 (almost 6,400 files); see github.com/briatte/integritate
Last login: Sun Dec 22 13:19:02 on ttys002
------:~ briatte$ R
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin10.8.0 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.