I would lke to run a chi2 test but using pw rather than fw.
If i use fw stata of course will not account for the proportion of my real sample giving me wrong p-values.
If I compute the chi2 by dividing for the total weighted and moltiplying for the total observed (i.e. ((401/2322)*85) tot number of real observation) I get a not significant test
Considering that the command [pw=weights] is not allowed with tab var1 var2, chi2, is there an alternative to account for the real size of the sample and thus use the pw?
Below an extraction of the database i am using.
Thanks
Code:
. tab mb_predictable kiwi_club [fw=new_w] if country==2,    chi2
          
 business 
predictabe       No-Club       Club      Total
1                       401            146           547 
2                       253              26           279 
3                       417            104           521 
4                       707            126           833 
5                       110              32           142 
Total      1,888        434      2,322 
Pearson chi2(4) =  48.0612   Pr = 0.000Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte mb_predictable long club float weights 3 1 26 1 1 26 1 1 26 1 0 95 4 0 16 4 0 26 4 0 16 4 0 26 4 0 26 3 0 16 3 0 16 1 1 26 1 0 26 1 0 16 2 0 16 4 1 16 2 0 16 1 0 95 2 0 16 2 0 16 3 1 26 3 0 26 3 0 95 3 0 16 1 0 16 1 0 95 4 0 16 4 1 26 4 1 16 4 0 16 2 0 26 5 0 26 5 0 26 1 0 16 5 0 16 4 0 26 3 1 26 5 0 16 1 0 26 1 1 26 4 0 16 5 1 16 4 0 26 2 0 16 2 0 26 2 0 95 5 0 26 4 0 16 4 0 16 4 0 26 4 0 26 4 0 16 4 0 16 4 1 26 4 0 16 3 1 26 2 1 26 4 0 26 4 0 16 4 1 16 3 0 95 4 0 16 3 0 16 3 0 95 3 0 26 4 0 16 4 0 16 2 0 26 4 1 26 4 0 26 1 1 26 4 0 16 4 0 16 4 0 16 4 0 16 4 0 16 1 0 16 4 0 16 4 0 26 3 0 16 4 0 95 4 0 16 5 1 16 4 0 16 1 1 16 end label values kiwi_club club label def club 0 "No-Club", modify label def club 1 "Club", modify
0 Response to chi2 test with probability weights
Post a Comment