I'm trying to figure out how to get the standard error of weighted proportions from data in R. I have reproducible code below showing how I go about getting the sums of the weights (getting the proportions then becomes simple enough), but I'm not sure how to go onto the next step in a way that sits well in R code. Thanks for your help!
set.seed(2514)
Data = data.frame(Country = sample(letters[1:3], 100, replace = T),
Group = sample(LETTERS[24:26], 100, replace = T),
Weight = rgeom(100,0.4)+1)
library(dplyr)
library(Hmisc)
Wts = Data %>% group_by(Country, Group) %>% summarise(n = n(), weight = sum(Weight))
print(Wts)