Announcement

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

  • bln tfte
    replied
    hi Mark,
    When I use "cate" in table1_mc for Fisher's test incase categories have small numbers, I am getting an error meassage that says " exceeded memory limits using exact(1); try again with larger #;........"
    Any advice?

    Leave a comment:


  • Steven Spivack
    replied
    Ok thanks so much for this tip.

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    Steven Spivack Sorry for the delayed response. I used the option display while running the tabxml command. This lets you see the output for all the different tests being run to create the table. In the output window, I just scrolled through to find the test I was looking for and its associated p-value and put the p-value in my table - yes tedious, but was the only option I saw.

    Unfortunately, I have not yet used the testparm command, so I cannot comment on that.

    Leave a comment:


  • Steven Spivack
    replied
    Originally posted by Ruth-Alma Turkson-Ocran View Post
    [USER="18711"]I find that when I examine continuous variables, I do not get the p-values (I can get them from the output window when I use the display command). I get the codes with the categorical/dichotomous variables. I also have to sometimes run it a few times differently to get what I want because some variables end up missing in the Excel output--To expand: I run it once with only continuous variables, then I run it again with only categorical variables and then copy/paste/rearrange in the Excel output, and save.
    I am not getting p values for any continuous variables either with tabxml. Instead, do you just regress each IV on the DV and then use the testparm command to get a p value, that is what I am doing now but it is not super efficient.

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    Steven Spivack No; I did not use the osvy option. My dataset is a survey with pweights so I svyset the data prior to using, so I left out the osvy option.

    UPDATE: I also believe I fixed my issue. I think the sex variable was tripping me up as I was trying to examine sex differences. So the code that worked for me was:

    Code:
    tabxml, dv(sex_r) ivc(age_p) ivd(married edu_cat poor2 emp_stat notcov usupl) order(age_p married edu_cat poor2 emp_stat notcov usupl) save("/location_filename_$datentime") display bold justify(c) subcond(black_african==1) pval sp
    I also like Table1, but its huge disadvantage is that it just does not work with weights.

    Regarding tabxml, I find that when I examine continuous variables, I do not get the p-values (I can get them from the output window when I use the display command). I get the codes with the categorical/dichotomous variables. I also have to sometimes run it a few times differently to get what I want because some variables end up missing in the Excel output--To expand: I run it once with only continuous variables, then I run it again with only categorical variables and then copy/paste/rearrange in the Excel output, and save.

    Leave a comment:


  • Steven Spivack
    replied
    Originally posted by Ruth-Alma Turkson-Ocran View Post
    What am I doing wrong?
    Did you use the osvy option? Have you installed dm49 which is required for tabxml?
    Last edited by Steven Spivack; 23 Oct 2018, 23:45.

    Leave a comment:


  • Steven Spivack
    replied
    Thanks again Ruth-Alma. I like the Table1 and tabout commands because they are so efficient and allow for ANOVA and Chi2, so I was hoping they would allow the use of aweights. It looks like tabxml does not allow for weights either when the data are not svyset.

    I am aware of these other commands but they are so much more tedious since I have to create 5 distinct descriptive tables which are quite long.
    Last edited by Steven Spivack; 23 Oct 2018, 23:44.

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    Steven Spivack Depending on what you want to examine, the following commands can handle analytic weights:

    tabstat (aweights, fweights)

    tabulate (aweights , fweights ) ...also goes with summarize...

    table ( fweights, iweights, and pweights)

    These are the few that come to mind...

    Leave a comment:


  • Steven Spivack
    replied
    Thanks for these examples. I am running into another problem with the table1 command though, which is that it does not appear to allow for the use of analytical weights. Do you know of another command that allows for this? I tried tabout but you need to survey set the data first which is not applicable for these analyses.

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    I forgot to add a sample of the dataset:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(age_p sex_r married edu_cat poor2 emp_stat) byte notcov float(usupl stay_us black_african)
    80 0 0 1 1 0 2 1 . 0
    56 0 1 3 3 0 2 1 1 0
    46 0 1 3 3 1 2 1 . 0
    22 0 0 2 3 1 2 1 . 0
    31 0 0 2 3 0 2 1 . 0
    56 0 0 1 3 1 2 1 . 0
    58 0 0 3 3 1 2 1 . 0
    55 0 0 2 1 0 2 1 . 0
    56 0 1 3 3 0 2 1 . 0
    58 0 1 1 2 0 2 1 . 0
    78 0 0 1 2 0 2 1 2 0
    62 0 1 1 3 0 2 1 . 0
    33 0 0 2 3 1 2 0 . 0
    59 0 1 1 3 1 1 0 . 0
    68 0 0 2 1 0 2 1 . 0
    20 0 0 1 1 0 1 1 . 0
    73 0 0 1 2 0 2 1 . 0
    64 0 0 2 3 1 2 1 . 0
    67 0 0 3 2 1 2 0 . 0
    55 0 0 3 3 0 1 0 . 0
    60 0 0 3 3 1 2 1 . 0
    62 0 0 1 2 0 1 1 . 0
    27 0 0 2 3 1 1 0 . 0
    76 0 0 . 3 0 2 1 1 1
    51 0 0 1 3 1 1 0 . 0
    35 0 0 2 3 1 2 1 2 1
    34 0 1 3 3 1 2 1 . 0
    45 0 1 1 3 0 1 1 . 0
    67 0 0 3 3 0 2 1 2 0
    24 0 0 3 3 0 2 1 . 0
    48 0 0 3 3 1 2 1 . 0
    38 0 0 1 3 0 2 1 2 1
    27 0 0 3 3 1 2 1 . 0
    54 0 0 1 2 1 2 1 . 0
    61 0 0 1 2 0 2 1 . 0
    33 0 1 3 3 1 2 1 . 0
    56 0 0 1 2 1 2 1 . 0
    28 0 0 2 1 0 2 1 . 0
    77 0 0 2 3 0 2 1 . 0
    81 0 0 1 3 0 2 1 . 0
    32 0 0 2 2 1 2 1 2 1
    58 0 1 2 3 1 2 1 . 0
    50 0 1 1 3 0 2 1 . 0
    35 0 1 2 2 0 2 1 . 0
    52 0 0 3 3 1 2 1 . 0
    59 0 1 3 3 1 2 1 . 0
    35 0 1 . 1 0 1 0 2 0
    59 0 0 1 1 0 2 1 . 0
    50 0 1 1 3 1 2 1 . 0
    29 0 0 1 1 0 2 1 2 1
    52 0 0 1 3 1 2 1 2 0
    25 0 0 1 3 1 2 1 . 0
    59 0 0 2 3 1 2 1 . 0
    30 0 0 1 1 1 2 1 1 1
    36 0 1 2 3 0 2 1 . 0
    28 0 0 2 2 1 1 0 . 0
    53 0 1 2 2 0 1 1 . 0
    25 0 1 3 2 0 2 0 . 0
    28 0 0 1 1 1 2 1 2 0
    34 0 1 3 3 1 2 1 1 0
    46 0 0 1 2 0 2 1 . 0
    35 0 1 1 3 1 1 0 2 1
    78 0 0 1 2 0 2 1 . 0
    81 0 1 2 3 0 2 1 . 0
    32 0 1 3 3 1 2 1 . 0
    30 0 0 2 2 1 1 1 . 0
    20 0 0 2 1 1 1 1 1 1
    70 0 1 2 3 0 2 1 . 0
    30 0 1 1 1 1 2 0 1 1
    38 0 0 3 3 1 2 1 . 0
    36 0 0 1 2 1 2 0 1 1
    78 0 0 1 3 0 2 1 . 0
    74 0 0 1 2 0 2 1 . 0
    27 0 0 2 3 1 1 0 . 0
    44 0 0 1 3 1 1 0 . 0
    65 0 1 2 3 0 2 1 . 0
    36 0 0 2 3 1 2 1 . 0
    25 0 0 2 1 0 2 1 . 0
    63 0 0 2 2 0 1 0 . 0
    32 0 0 3 3 1 2 1 . 0
    71 0 1 1 3 0 2 1 . 0
    82 0 1 1 3 0 2 1 . 0
    65 0 1 1 3 1 2 1 . 0
    46 0 1 2 2 1 1 0 . 0
    31 0 0 3 1 0 2 1 1 1
    55 0 1 1 3 1 1 0 2 1
    55 0 1 1 2 0 1 1 2 0
    57 0 1 2 2 0 2 1 . 0
    27 0 1 2 3 1 2 1 2 1
    37 0 1 2 3 1 2 1 . 0
    31 0 0 1 3 1 1 1 1 0
    69 0 0 2 2 0 2 1 . 0
    21 0 0 1 1 0 1 1 . 0
    20 0 0 2 3 1 2 0 . 0
    60 0 0 3 3 0 2 1 . 0
    36 0 1 1 2 1 1 1 2 1
    36 0 1 3 2 1 2 1 . 0
    24 0 0 1 3 0 1 0 . 0
    66 0 0 2 2 1 2 1 . 0
    26 0 1 1 1 1 1 1 . 0
    end
    label values age_p pep031x
    label values sex_r sex_r
    label def sex_r 0 "0: Females", modify
    label values married married
    label def married 0 "0: Not Married", modify
    label def married 1 "1: Currently Married", modify
    label values edu_cat edu_cat
    label def edu_cat 1 "1: High School", modify
    label def edu_cat 2 "2: College", modify
    label def edu_cat 3 "3: Graduate School", modify
    label values poor2 poor2
    label def poor2 1 "1: Poor", modify
    label def poor2 2 "2: Near Poor", modify
    label def poor2 3 "3: Not Poor/Near Poor", modify
    label values emp_stat emp_stat
    label def emp_stat 0 "0: Unemployed", modify
    label def emp_stat 1 "1: Employed", modify
    label values notcov pep394x
    label def pep394x 1 "1 Not covered", modify
    label def pep394x 2 "2 Covered", modify
    label values usupl usupl
    label def usupl 0 "0: Do not have a usual place", modify
    label def usupl 1 "1: Have a usual place", modify
    label values stay_us stay_us
    label def stay_us 1 "1: ≥ 5 yrs but < 10 yrs", modify
    label def stay_us 2 "2: ≥ 10 years", modify
    label values black_african black_african
    label def black_african 0 "0: Not Black African", modify
    label def black_african 1 "1: Black African", modify
    Also, please delete racreci3 from the code in the previous post. The true code should be:

    Code:
    tabxml, ivc(age_p) ivd(sex_r married edu_cat poor2 emp_stat notcov usupl stay_us) order(age_p sex_r married edu_cat poor2 emp_stat notcov usupl stay_us) save("/location_filename_$datentime") split(sex_r) options(n per) display bold justify(c) pval sp

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    On another note, I am using tabxml in Stata 14.2 and trying to do another Table 1 by sex. When using variations of this code:

    Code:
     tabxml, ivc(age_p) ivd(sex_r married racreci3 edu_cat poor2 emp_stat notcov usupl) order(age_p sex_r racreci3 married edu_cat poor2 emp_stat notcov usupl) save("/location_filename_$datentime") split(sex_r) options(n per) display bold justify(c) pval sp
    I keep getting errors such as: "invalid subpop() option" when I try using the subcond option. I also get this error:

    Code:
    Table contains a zero in the marginals.
      Statistics cannot be computed.
    conformability error
    r(503);
    when I use this code:

    Code:
     tabxml, ivc(age_p) ivd(sex_r married racreci3 edu_cat poor2 emp_stat notcov usupl) order(age_p sex_r racreci3 married edu_cat poor2 emp_stat notcov usupl) save("/location_filename_$datentime") split(sex_r) options(n per) display bold justify(c) pval sp
    What am I doing wrong?

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    Hi Steven,

    I know of comparing three groups. I believe you can use the
    Code:
    split(varname)
    option to do that...(I don't get a p-value for comparing two groups if that helps) If anyone has been able to figure out how to get the significance levels for that, it would be nice, otherwise, I use the option:
    Code:
    display
    to get the p-values in the display window and manually enter them in your table. Hope this helps

    Leave a comment:


  • Steven Spivack
    replied
    Hi Mark

    Can this command be used to compare three groups or only two. For example, if I have three groups and I compare means between them, is the program running a ttest or anova. I believe the program accurately runs an anova but I just wanted to be sure.

    Steven

    Leave a comment:


  • Ruth-Alma Turkson-Ocran
    replied
    Thanks Mark, Sorry about the super late reply on this, I thought I replied. The tabxml worked great for me.

    Leave a comment:


  • Mark Chatfield
    replied
    I have just become aware of the user written -tabxml- command, which can deal with survey data.

    net install sg100, from(http://www.stata.com/stb/stb47)
    *to avoid matsum error message

    net install tabxml.pkg

    Leave a comment:

Working...
X