set.seed(123)
library(dplyr)
dummy_data <- data.frame(
years_education = rnorm(100, 12, 3), # Represents years of education
gender_female = rbinom(100, 1, 0.5), # 1 = Female, 0 = Male
household_wealth = sample(1:5, 100, replace = TRUE), # Wealth index from 1 to 5
district_code = sample(1:10, 100, replace = TRUE) # Represents district codes
) %>% arrange(district_code)
# Define a simple regression formula
formula <- years_education ~ gender_female + household_wealth + household_wealth:gender_female
# Run the regression across all locations (districts)
results1 <- Replm2(dummy_data, formula, "district_code", "normal")
print(results1)
Run the code above in your browser using DataLab