Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • command pbalchk with fator variables

    Hello, I am trying t use the command pbalchk to examine the balance of covariates with ipw weights. A shortened version of the model is below..daetaex would not accept all the variables becuase it was too many. I keep getting a error that pbalchk will not accept factor variables. Can you advise? Is it possible to use pbalchk and specify factor variables?


    pbalchk pt_nopt ib0.agecat ib0.sex ib0.urb_rural ib0.insur_cat ib0.high_dprc , wt(ipt_wt)



    Code:
     * Example generated by -dataex-. To install: ssc install dataex clear input long person_id float(pt_nopt agecat sex urb_rural high_dprc) 31667 0 0 0 1 0 32318 0 4 1 1 0 19493 0 2 0 1 1 23984 0 0 1 1 0 31852 0 0 0 1 0 41659 0 0 0 1 0 23610 0 3 1 1 0 1239 0 0 1 1 0 43597 0 4 0 1 0 10766 0 1 1 0 0 24148 0 4 1 1 0 40014 0 1 0 1 0 24222 0 3 1 1 0 7455 0 4 1 1 0 26468 0 4 1 0 0 49046 0 4 1 0 0 379 0 2 1 1 0 17246 0 3 0 1 0 849 0 2 1 1 0 25780 0 1 1 1 0 24539 0 1 1 1 1 30316 0 0 1 1 0 28353 0 0 1 1 2 24412 0 0 1 1 0 12309 0 2 1 1 1 45131 0 4 1 1 0 31800 0 6 1 1 0 10678 0 1 1 1 0 49679 0 1 1 0 0 20905 0 3 0 1 0 13808 0 1 1 1 0 823 0 2 0 0 0 16344 0 0 1 1 0 24687 0 1 1 1 0 49068 0 2 0 2 0 29688 0 3 0 1 0 9725 0 2 0 1 0 39006 0 0 1 1 1 18322 0 1 0 0 0 34363 0 3 0 1 0 30714 0 4 1 1 0 24845 0 1 0 1 0 14268 0 0 0 1 0 43042 0 2 0 0 0 733 0 4 1 1 0 35389 0 2 0 1 2 35577 0 0 0 0 0 21602 0 0 0 0 0 29515 0 3 0 1 0 16199 0 1 1 1 0 30346 0 1 0 1 0 40830 0 1 1 1 0 29207 0 1 1 0 0 25319 0 1 0 1 0 11565 0 1 0 1 0 32818 0 1 1 1 1 46444 0 3 0 1 1 26574 0 0 1 1 0 20961 0 1 1 0 0 16211 0 2 0 1 1 41446 0 0 1 2 2 31047 0 4 1 1 0 7205 0 0 1 0 1 25411 0 1 0 1 0 10734 0 1 1 1 2 28888 0 0 1 1 0 48630 0 3 1 0 0 25358 0 1 1 1 0 38016 0 2 0 1 0 18566 0 1 1 1 0 51091 0 1 0 0 0 25693 0 4 1 1 0 25700 0 5 0 1 0 13598 0 2 0 1 0 25705 0 6 1 1 0 40361 0 1 1 0 0 3800 0 1 0 0 1 47078 0 0 1 1 0 25775 0 0 0 0 0 12930 0 0 0 1 0 5829 0 0 1 1 0 29757 0 1 0 1 0 4545 0 4 0 0 0 1453 0 4 1 2 2 25863 0 3 0 1 0 12581 0 3 0 1 0 40037 0 0 1 1 0 25936 0 4 0 1 0 16876 0 1 1 0 0 700 0 2 0 1 0 18242 0 4 0 1 1 50143 0 2 0 1 0 19737 0 1 0 0 0 23112 0 3 1 1 0 7107 0 3 0 1 0 12929 0 1 0 2 1 290 0 2 0 1 0 15442 0 4 0 1 0 5304 0 0 1 1 0 22846 0 2 1 1 0 end label values pt_nopt pt_nopt_lab label def pt_nopt_lab 0 "0 no PT", modify label values agecat agecat_lab label def agecat_lab 0 "0= 18-29", modify label def agecat_lab 1 "1=30-39", modify label def agecat_lab 2 "2=40-49", modify label def agecat_lab 3 "3= 50-59", modify label def agecat_lab 4 "4=60-69", modify label def agecat_lab 5 "5=70-79", modify label def agecat_lab 6 "6=80-89", modify label values sex sex_lab label def sex_lab 0 "0 = female", modify label def sex_lab 1 "1=male", modify label values urb_rural urb_rural_lab label def urb_rural_lab 0 " 0 = rur", modify label def urb_rural_lab 1 "1 = urban", modify label def urb_rural_lab 2 "2 = mis", modify label values high_dprc high_dprc_lab label def high_dprc_lab 0 "0= not HD", modify label def high_dprc_lab 1 "1= high DP", modify label def high_dprc_lab 2 "2= mis", modify

  • #2
    You may have to revert to using the xi: prefix command. I'm not familiar with the command you referenced, but it's likely the authors haven't updated it to accept the usual factor variable syntax.
    Please use the code delimiters to show code and results - use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Please use the command -dataex- to show a representative sample of data; it is installed already if you have Stata 14.2 or 15.1, else you can install it by typing

    Code:
    ssc install dataex

    Comment

    Working...
    X