SE of Weighted Proportions?

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)

This may help.

1 Like

It does! Definitely makes me feel less crazy.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.