Announcement

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

  • Bonferroni output problem: period instead of p-value

    Hi all!

    I have done multiple Bonferroni tests but something about my data and the code is not giving me the full output with the p-value.

    I have 1 dependent variable and 2 independent variables (one is a week number and the other is a category number). Since I couldn't figure out how to 2 independent variables in Stata and the independent variables don't need to be significant when compared each other, I separated them in my excel sheet. I thought I could just run the test four times, which would suit my needs, but Stata gives me the below output instead. I can't find a different way to do it in any of the manuals or on any of the other forums. The only thing I can think is wrong is something with my data. I put a similar sample of my data below. Can anyone explain what's wrong and how I can fix it so I can tell if the Category1_Percent for 1 is statistically different from 2 or 3?

    Category1 Category1_Percent
    1 12.8
    2 50.1
    3 52.6

    Click image for larger version

Name:	Screen Shot 2017-04-05 at 2.42.15 PM.png
Views:	1
Size:	33.9 KB
ID:	1382295

  • #2
    I'm not sure but it looks like you are trying to estimate differences without enough data. Are the percents you show the data or summaries of data replicated in each category?

    Comment


    • #3
      They are percents from a larger sample. Basically I need to figure out if the percent of category 1 at week 1 is different from category 1 at week 2 and so forth. So I have already divided the entire data set and calculated the percents (ie # of category 1/total week 1 count). I wondered earlier if it was the small data set so I made up a data set and doubled and tripled the data numbers (with random numbers) and it did the same. I know its not my Stata program because my other data set still works in Stata for Bonferroni's method. Any thoughts or other types of test that might be able to tell me the significance?

      Comment


      • #4
        Jeni:
        what if you analyse your data with -regress-?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Carlo Lazzaro That would only show me the relationship between the weeks not if they are statistically different from each other right?

          Maybe more about my data would help. I have 3 separate weeks of data in which I categorized the measurements as Category 1-4. For each week I calculated what percent of that week was in category 1, 2, 3, and 4. Now I need to figure out if week 1's category 1's percent is significantly different from week 2's category 1's percent and so on for the other week. Typically, I would use Bonferroni like I tried above but something about the data just isn't giving me what I need....

          Comment


          • #6
            Did you look at the data you created by making percents? If you made a mistake at that point, creating percents that were the same for all observations within groups, that could produce the kind of output you show, at least in terms of the within groups SS being 0. But you also show no df for that, so I dunno. Maybe show some of the data and the exact code?

            Dave
            Last edited by Dave Airey; 06 Apr 2017, 13:04.

            Comment


            • #7
              I did that all in Excel so I know there aren't errors there. It was just this cell divided by this cell times 100. It is definitely a strange problem that I have never had before...

              Comment


              • #8
                Originally posted by Jeni Ten Eyck View Post
                I wondered earlier if it was the small data set so I made up a data set and doubled and tripled the data numbers (with random numbers) and it did the same.
                From the ANOVA table in your original post above, it certainly was the smallness of your dataset—two degrees of freedom total in that model says that you have only three observations in total.

                I assume that you don't want to disclose your original dataset for anyone to look at, but you mention that you get the same problem with your made-up dataset. If you can't post your original dataset, then why don't you attach that made-up dataset that reproducibly gives the same problem and let others on the list take a look? You can attach it either as a .csv or tab-delimited plain text file (use export delimited) or as a Stata dataset (you need to change the file extension from .dta to .txt in order to attach a Stata dataset).

                If you are willing to disclose your original dataset, then you can either attach the Excel workbook, itself, or export it to .csv or tab-delimited plain text file and attach that for those on the list who are wary of Excel workbooks.

                Comment


                • #9
                  Joseph Coveney I would prefer not to put my data online. Below is literally the same thing (the entire set not split up, which is how I tired it) with different numbers. There are 3 weeks and 4 categories. Each week adds up to 100. As I mentioned before, I need to compare all of the category 1s against each other and see if they are statistically significant. The original data from the actual categorization is just me counting the number for each category and finding a percent (eg (category 1/all week 1)*100).

                  -Thank you for trying to help!
                  Jeni
                  Week Category Percent
                  1 1 75
                  1 2 25
                  1 3 0
                  1 4 0
                  2 1 60
                  2 2 20
                  2 3 20
                  2 4 0
                  3 1 40
                  3 2 20
                  3 3 10
                  3 4 10

                  Comment


                  • #10
                    Code:
                    version 14.2
                    
                    clear *
                    set more off
                    
                    input byte(Week Category Percent)
                    1     1     75
                    1     2     25
                    1     3     0
                    1     4     0
                    2     1     60
                    2     2     20
                    2     3     20
                    2     4     0
                    3     1     40
                    3     2     20
                    3     3     10
                    3     4     10
                    end
                    
                    anova Percent i.Week i.Category
                    
                    contrast r.Category, mcompare(bonferroni) noeffects
                    
                    exit
                    I don't know about your independent variable. The way you describe how it's constructed sounds strange. You might want to model the counts directly with a generalized linear model instead of summing them somehow and dividing by the weekly total or whatever.

                    Comment


                    • #11
                      Joseph Coveney Thanks for trying to help. That ended up comparing the categories to each other instead of comparing the weeks to each other. I know the basics of Stata but not too much past my normal t-tests and correlations.

                      Basically my study is about looking at histological changes from week to week within a specific organ in diseased state. For this data set, I looked at a particular structure and categorized them based on their type. So comparing how many category 1's differ over time is this part of the projects main objective. Linear models and regression aren't the statistics I need to prove statistical difference between the weeks...

                      -Thanks for trying!
                      Jeni

                      Comment


                      • #12
                        I agree that linear models aren't what you're probably going to need to assess how counts (or proportion) of Category 1 microscopic finding change over three weeks.

                        I said generalized linear model, though.
                        Last edited by Joseph Coveney; 06 Apr 2017, 20:37.

                        Comment

                        Working...
                        X