Weighting tables in expss

341 Views Asked by At

I have a column of numbers [range from 0.2 to 2.3] in a column called cwei in SPSS. I want to use these weights as case weights in expss tab_ logic. My efforts so far work and produce a table but it is unweighted. Where is my error?

  tab_cols(total(),Ban2) %>% 
  tab_cells(Gender) %>% 
  tab_stat_cpct() %>% 
  tab_weight(vardata$cwei) %>% 
  tab_pivot()```
1

There are 1 best solutions below

0
On

You need to weight table before the statistic calculation:

tab_cols(total(),Ban2) %>% 
  tab_cells(Gender) %>% 
  tab_weight(vardata$cwei) %>% 
  tab_stat_cpct() %>% 
  tab_pivot()