Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created February 24, 2025 05:54
Show Gist options
  • Save njtierney/0a896e7f0bce33bd49e57cf1d9a99ef8 to your computer and use it in GitHub Desktop.
Save njtierney/0a896e7f0bce33bd49e57cf1d9a99ef8 to your computer and use it in GitHub Desktop.
library(tidyverse)
# example structure of the data
# some of the columns are:
# Months (1 2 3, 13, 14 15), Arm (control, intervention)
# Before_After (beofre, after), Village ( 1:8), household (1:8), weight (number?)
# this is painful...
tibble(
month = c(1, 1, 2, 2, 3, 3, 13, 13, 14, 14, 15, 15),
arm = c(rep("control", 2)
)
data_template <- expand_grid(
month = c(1:3, 13:15),
arm = c("control", "intervention"),
before_after = c("before", "after"),
village = 1:8,
household = 1:8,
weight = NA
)
data_template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment