Announcement

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

  • F statistic not obtained using oneway

    Hello,

    I ran the following code and the resulting output didn't include the F-statistic. The unequal n and the similarity in the means could be problematic. Any advice is appreciated if this is the likely problem or it is some other issue.

    If the output is too garbled and there is a better way to present it, let me know.
    Regards

    Bob



    oneway offencenum why_03, tabulate

    | Summary of offencenum
    Why | Mean Std. Dev. Freq.
    ------------+------------------------------------
    closed | 3 0 11
    new | 3.4056604 0 106
    open | 3 0 20
    ------------+------------------------------------
    Total | 3.3138686 .17035961 137

    Analysis of Variance
    Source SS df MS F Prob > F
    ------------------------------------------------------------------------
    Between groups 3.94704612 2 1.97352306
    Within groups 0 134 0
    ------------------------------------------------------------------------
    Total 3.94704612 136 .029022398

    .
    Last edited by Bob Green; 18 Jul 2018, 02:49.

  • #2
    This is very hard to read because you're ignoring key guidelines in the FAQ Advice: give a data example and show code and results using CODE delimiters. You are asked to read the FAQ Advice before posting -- in every new post prompt.

    But the underlying problem is easy to guess.

    Your analysis appears equivalent to this:

    Code:
    clear
    input str6 x y freq
    closed  3  11
    new  3.4056604 106
    open  3 20
    end
    
    expand freq
    
    oneway y x
    
    
                            Analysis of Variance
        Source              SS         df      MS            F     Prob > F
    ------------------------------------------------------------------------
    Between groups      3.94704612      2   1.97352306
     Within groups               0    134            0
    ------------------------------------------------------------------------
        Total           3.94704612    136   .029022398
    The unequal numbers in the three groups are immaterial and not at all the problem. The problem is that values in each group are constant. So within-group variation is zero and oneway can't give you a F for the same reason as 3.947 or so divided by zero is indeterminate.

    The diagnosis is, loosely, too little coffee, or whatever else gets you going. I guess you've calculated the means for the groups and then fed the means to oneway. Don't do that: feed oneway the original data. Otherwise if these are someone else's means and you don't have their data, no way forward.
    Last edited by Nick Cox; 18 Jul 2018, 03:04.

    Comment


    • #3
      Hello Nick,

      Many thanks. I had searched the FAQ but was looking for display of output and didn't realise CODE referred to in section 12.3 could be used with output as well as code.

      Your diagnosis was spot on. I had joined two files and the mean for the groups must have been repeated across observations. Selecting another variable fixed the issue.

      Comment


      • #4
        Just think about your Results window: code and results are shown in the same way in a fixed-width font. Same simple idea.

        We'll tweak the FAQ to make that more explicit.
        Last edited by Nick Cox; 18 Jul 2018, 04:13.

        Comment


        • #5
          Thanks Nick. I also found your post on converting excel time to stata time, answered another question that I had

          Comment


          • #6
            Bob, should you ever want to perform ANOVA using summary data as input, see the following:

            Code:
            net describe sg132, from(http://www.stata.com/stb/stb54)
            Cheers,
            Bruce
            --
            Bruce Weaver
            Email: [email protected]
            Version: Stata/MP 18.5 (Windows)

            Comment


            • #7
              Many thanks Bruce

              Comment

              Working...
              X