i have dataset stratified across 3 different populations , resulted in following sampling pattern:
b c pop size 713 2904 4687 8305 num sampled 72 135 159 in order make statistic representative of entire distribution created weight each sample population (a,b,c).
to computed fraction of each population sampled, divided fraction of entire population sampled, , normalized these.
weight 0.16 0.35 0.48 i added column data set follows:
wt <- c(0.16, 0.35, 0.48) mydata$weight <- wt[mydata$popgroup] i can use weight column wtd.hist or wtd.mean functions or using weight aesthetic in ggplot.
what can not figure out how perform statistical tests on weighted data. specifically, neither shapiro.test nor prop.test functions support weight parameter.
Comments
Post a Comment