Skip to content

Instantly share code, notes, and snippets.

Avatar

pomontiglio-uqam

View GitHub Profile
View simulation.données.simple.r
set.seed(0)
nobs = 100
nind = 100
nlevels <- 4
levels.cat <- rnorm(n = nlevels, mean = 0, sd = 2)
indbt <- rnorm(n = nind, mean = 0, sd = 2)
id <- rep(1:nind, each = nobs)
categorique <- sample(x = 1:4, size = nobs*nind, replace = TRUE)
table.cat <- data.frame(categorique = 1:4, val = levels.cat)