Skip to content

Instantly share code, notes, and snippets.

@rocarvaj
Last active April 1, 2022 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocarvaj/8b795d0618a45cbba05ea33469c0d01d to your computer and use it in GitHub Desktop.
Save rocarvaj/8b795d0618a45cbba05ea33469c0d01d to your computer and use it in GitHub Desktop.
Generador de datos por grupo en Proyecto RCD II
# Cargar base de datos (requiere cargar tidyverse y readxl)
MK <- read_excel("NIELSEN01V2.xlsx")
# Escribir en la función set.seed() el código de cuatro dígitos asignado
# a tu grupo para obtener los datos que el grupo deber analizar
set.seed(CodigoGrupo)
p = 0.8 # Proporción de la muestra
BaseGrupo <- MK %>%
sample_n(size = ceiling(p*nrow(MK)), replace = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment