What hypothesis test is suitable in this case?











up vote
-1
down vote

favorite












Null: Event frequency does not vary by weekday
Alternate: Event frequency varies by weekday



Data:
Day: Mon, Tue, Wed, Thu, Fri, Sat, Sun
event_count: 12, 15, 20, 10, 19, 10, 11



What hypothesis test (e.g chi-squared, p-test) would be best to investigate this relationship?










share|cite|improve this question


















  • 1




    Sounds like a goodness of fit.
    – Sean Roberson
    Nov 24 at 18:58










  • You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
    – BruceET
    Nov 24 at 20:52

















up vote
-1
down vote

favorite












Null: Event frequency does not vary by weekday
Alternate: Event frequency varies by weekday



Data:
Day: Mon, Tue, Wed, Thu, Fri, Sat, Sun
event_count: 12, 15, 20, 10, 19, 10, 11



What hypothesis test (e.g chi-squared, p-test) would be best to investigate this relationship?










share|cite|improve this question


















  • 1




    Sounds like a goodness of fit.
    – Sean Roberson
    Nov 24 at 18:58










  • You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
    – BruceET
    Nov 24 at 20:52















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Null: Event frequency does not vary by weekday
Alternate: Event frequency varies by weekday



Data:
Day: Mon, Tue, Wed, Thu, Fri, Sat, Sun
event_count: 12, 15, 20, 10, 19, 10, 11



What hypothesis test (e.g chi-squared, p-test) would be best to investigate this relationship?










share|cite|improve this question













Null: Event frequency does not vary by weekday
Alternate: Event frequency varies by weekday



Data:
Day: Mon, Tue, Wed, Thu, Fri, Sat, Sun
event_count: 12, 15, 20, 10, 19, 10, 11



What hypothesis test (e.g chi-squared, p-test) would be best to investigate this relationship?







statistics statistical-inference hypothesis-testing






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 24 at 18:54









thatsnotmyname71

1




1








  • 1




    Sounds like a goodness of fit.
    – Sean Roberson
    Nov 24 at 18:58










  • You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
    – BruceET
    Nov 24 at 20:52
















  • 1




    Sounds like a goodness of fit.
    – Sean Roberson
    Nov 24 at 18:58










  • You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
    – BruceET
    Nov 24 at 20:52










1




1




Sounds like a goodness of fit.
– Sean Roberson
Nov 24 at 18:58




Sounds like a goodness of fit.
– Sean Roberson
Nov 24 at 18:58












You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
– BruceET
Nov 24 at 20:52






You might have avoided down-votes by venturing a solution and asking us whether it is correct. This once, I will give an outline of a chi-squared test as suggested by @SeanRoberson for you to follow and verify.
– BruceET
Nov 24 at 20:52












1 Answer
1






active

oldest

votes

















up vote
1
down vote













Outline of the appropriate chi-squared test:



Chi-squared goodness-of-fit test. Null hypothesis is that days are equally
likely categories for events: probability $1/7$ for each day. So out of
your 97 events the 'expected number' on each day is $E = 97/7 = 13.85714.$



Under the null hypothesis, the test statistic
$$Q = sum_{i=1}^7 frac{(X_i - E)^2}{E}$$
is approximately distributed as $mathsf{Chisq}(text{df} = 6).$



Check your text for this formula, possibly with slightly different
notation. Also, perhaps you can find a similar problem worked as an
example.



The computations below, using R statistical software, show
there is no evidence that events are other than evenly distributed
across days. You should verify the computations using a calculator and
the critical value from a printed table of chi-squared distributions (or
using a statistical calculator). [If you use a printed table, look on the row for DF = 6.]



X = c(12, 15, 20, 10, 19, 10, 11);  t = sum(X)
[1] 97
E = 97/7
Q = sum((X - E)^2/E); Q
[1] 7.71134
qchisq(.95, 6)
[1] 12.59159 # critical value for 5% level test; Q < critical value
1 - pchisq(Q, 6)
[1] 0.2600232 # P-value of test > 5%




Note: The histogram below shows simulated values of $Q$ for 100,000 weeks where
days are equally likely. The density curve of $mathsf{Chisq}(6)$ is shown
in black. The histogram is well approximated by the chi-squared density.



enter image description here



Here is the approximate distribution of $Q$ when days are unlikely in such a way that two days (perhaps on weekends) share half of the events and the other five days share the other half. [Specifically, alternative probability vector $p_a = (.25, .1, .1, .1, .1, .1, .25).]$ The distribution is nowhere near
$mathsf{Chisq}(6).$ Most of the probability is above $12.6.$



enter image description here



Note: Here is R code for the first figure:



set.seed(1124);  m = 10^5;  n = 97;  E = 97/7; q = numeric(m)
for(i in 1:m) {
d = sample(1:7, n, rep=T)
rle.inf = rle(sort(d)); X = rle.inf$len
q[i] = sum((X-E)^2/E) }
hist(q, prob=T, br=50, col="skyblue2", ylim=c(0, .14),
main="Simulated CHISQ(6) with Density")
curve(dchisq(x, 6), 0, 25, add=T, lwd=2)





share|cite|improve this answer























    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011944%2fwhat-hypothesis-test-is-suitable-in-this-case%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Outline of the appropriate chi-squared test:



    Chi-squared goodness-of-fit test. Null hypothesis is that days are equally
    likely categories for events: probability $1/7$ for each day. So out of
    your 97 events the 'expected number' on each day is $E = 97/7 = 13.85714.$



    Under the null hypothesis, the test statistic
    $$Q = sum_{i=1}^7 frac{(X_i - E)^2}{E}$$
    is approximately distributed as $mathsf{Chisq}(text{df} = 6).$



    Check your text for this formula, possibly with slightly different
    notation. Also, perhaps you can find a similar problem worked as an
    example.



    The computations below, using R statistical software, show
    there is no evidence that events are other than evenly distributed
    across days. You should verify the computations using a calculator and
    the critical value from a printed table of chi-squared distributions (or
    using a statistical calculator). [If you use a printed table, look on the row for DF = 6.]



    X = c(12, 15, 20, 10, 19, 10, 11);  t = sum(X)
    [1] 97
    E = 97/7
    Q = sum((X - E)^2/E); Q
    [1] 7.71134
    qchisq(.95, 6)
    [1] 12.59159 # critical value for 5% level test; Q < critical value
    1 - pchisq(Q, 6)
    [1] 0.2600232 # P-value of test > 5%




    Note: The histogram below shows simulated values of $Q$ for 100,000 weeks where
    days are equally likely. The density curve of $mathsf{Chisq}(6)$ is shown
    in black. The histogram is well approximated by the chi-squared density.



    enter image description here



    Here is the approximate distribution of $Q$ when days are unlikely in such a way that two days (perhaps on weekends) share half of the events and the other five days share the other half. [Specifically, alternative probability vector $p_a = (.25, .1, .1, .1, .1, .1, .25).]$ The distribution is nowhere near
    $mathsf{Chisq}(6).$ Most of the probability is above $12.6.$



    enter image description here



    Note: Here is R code for the first figure:



    set.seed(1124);  m = 10^5;  n = 97;  E = 97/7; q = numeric(m)
    for(i in 1:m) {
    d = sample(1:7, n, rep=T)
    rle.inf = rle(sort(d)); X = rle.inf$len
    q[i] = sum((X-E)^2/E) }
    hist(q, prob=T, br=50, col="skyblue2", ylim=c(0, .14),
    main="Simulated CHISQ(6) with Density")
    curve(dchisq(x, 6), 0, 25, add=T, lwd=2)





    share|cite|improve this answer



























      up vote
      1
      down vote













      Outline of the appropriate chi-squared test:



      Chi-squared goodness-of-fit test. Null hypothesis is that days are equally
      likely categories for events: probability $1/7$ for each day. So out of
      your 97 events the 'expected number' on each day is $E = 97/7 = 13.85714.$



      Under the null hypothesis, the test statistic
      $$Q = sum_{i=1}^7 frac{(X_i - E)^2}{E}$$
      is approximately distributed as $mathsf{Chisq}(text{df} = 6).$



      Check your text for this formula, possibly with slightly different
      notation. Also, perhaps you can find a similar problem worked as an
      example.



      The computations below, using R statistical software, show
      there is no evidence that events are other than evenly distributed
      across days. You should verify the computations using a calculator and
      the critical value from a printed table of chi-squared distributions (or
      using a statistical calculator). [If you use a printed table, look on the row for DF = 6.]



      X = c(12, 15, 20, 10, 19, 10, 11);  t = sum(X)
      [1] 97
      E = 97/7
      Q = sum((X - E)^2/E); Q
      [1] 7.71134
      qchisq(.95, 6)
      [1] 12.59159 # critical value for 5% level test; Q < critical value
      1 - pchisq(Q, 6)
      [1] 0.2600232 # P-value of test > 5%




      Note: The histogram below shows simulated values of $Q$ for 100,000 weeks where
      days are equally likely. The density curve of $mathsf{Chisq}(6)$ is shown
      in black. The histogram is well approximated by the chi-squared density.



      enter image description here



      Here is the approximate distribution of $Q$ when days are unlikely in such a way that two days (perhaps on weekends) share half of the events and the other five days share the other half. [Specifically, alternative probability vector $p_a = (.25, .1, .1, .1, .1, .1, .25).]$ The distribution is nowhere near
      $mathsf{Chisq}(6).$ Most of the probability is above $12.6.$



      enter image description here



      Note: Here is R code for the first figure:



      set.seed(1124);  m = 10^5;  n = 97;  E = 97/7; q = numeric(m)
      for(i in 1:m) {
      d = sample(1:7, n, rep=T)
      rle.inf = rle(sort(d)); X = rle.inf$len
      q[i] = sum((X-E)^2/E) }
      hist(q, prob=T, br=50, col="skyblue2", ylim=c(0, .14),
      main="Simulated CHISQ(6) with Density")
      curve(dchisq(x, 6), 0, 25, add=T, lwd=2)





      share|cite|improve this answer

























        up vote
        1
        down vote










        up vote
        1
        down vote









        Outline of the appropriate chi-squared test:



        Chi-squared goodness-of-fit test. Null hypothesis is that days are equally
        likely categories for events: probability $1/7$ for each day. So out of
        your 97 events the 'expected number' on each day is $E = 97/7 = 13.85714.$



        Under the null hypothesis, the test statistic
        $$Q = sum_{i=1}^7 frac{(X_i - E)^2}{E}$$
        is approximately distributed as $mathsf{Chisq}(text{df} = 6).$



        Check your text for this formula, possibly with slightly different
        notation. Also, perhaps you can find a similar problem worked as an
        example.



        The computations below, using R statistical software, show
        there is no evidence that events are other than evenly distributed
        across days. You should verify the computations using a calculator and
        the critical value from a printed table of chi-squared distributions (or
        using a statistical calculator). [If you use a printed table, look on the row for DF = 6.]



        X = c(12, 15, 20, 10, 19, 10, 11);  t = sum(X)
        [1] 97
        E = 97/7
        Q = sum((X - E)^2/E); Q
        [1] 7.71134
        qchisq(.95, 6)
        [1] 12.59159 # critical value for 5% level test; Q < critical value
        1 - pchisq(Q, 6)
        [1] 0.2600232 # P-value of test > 5%




        Note: The histogram below shows simulated values of $Q$ for 100,000 weeks where
        days are equally likely. The density curve of $mathsf{Chisq}(6)$ is shown
        in black. The histogram is well approximated by the chi-squared density.



        enter image description here



        Here is the approximate distribution of $Q$ when days are unlikely in such a way that two days (perhaps on weekends) share half of the events and the other five days share the other half. [Specifically, alternative probability vector $p_a = (.25, .1, .1, .1, .1, .1, .25).]$ The distribution is nowhere near
        $mathsf{Chisq}(6).$ Most of the probability is above $12.6.$



        enter image description here



        Note: Here is R code for the first figure:



        set.seed(1124);  m = 10^5;  n = 97;  E = 97/7; q = numeric(m)
        for(i in 1:m) {
        d = sample(1:7, n, rep=T)
        rle.inf = rle(sort(d)); X = rle.inf$len
        q[i] = sum((X-E)^2/E) }
        hist(q, prob=T, br=50, col="skyblue2", ylim=c(0, .14),
        main="Simulated CHISQ(6) with Density")
        curve(dchisq(x, 6), 0, 25, add=T, lwd=2)





        share|cite|improve this answer














        Outline of the appropriate chi-squared test:



        Chi-squared goodness-of-fit test. Null hypothesis is that days are equally
        likely categories for events: probability $1/7$ for each day. So out of
        your 97 events the 'expected number' on each day is $E = 97/7 = 13.85714.$



        Under the null hypothesis, the test statistic
        $$Q = sum_{i=1}^7 frac{(X_i - E)^2}{E}$$
        is approximately distributed as $mathsf{Chisq}(text{df} = 6).$



        Check your text for this formula, possibly with slightly different
        notation. Also, perhaps you can find a similar problem worked as an
        example.



        The computations below, using R statistical software, show
        there is no evidence that events are other than evenly distributed
        across days. You should verify the computations using a calculator and
        the critical value from a printed table of chi-squared distributions (or
        using a statistical calculator). [If you use a printed table, look on the row for DF = 6.]



        X = c(12, 15, 20, 10, 19, 10, 11);  t = sum(X)
        [1] 97
        E = 97/7
        Q = sum((X - E)^2/E); Q
        [1] 7.71134
        qchisq(.95, 6)
        [1] 12.59159 # critical value for 5% level test; Q < critical value
        1 - pchisq(Q, 6)
        [1] 0.2600232 # P-value of test > 5%




        Note: The histogram below shows simulated values of $Q$ for 100,000 weeks where
        days are equally likely. The density curve of $mathsf{Chisq}(6)$ is shown
        in black. The histogram is well approximated by the chi-squared density.



        enter image description here



        Here is the approximate distribution of $Q$ when days are unlikely in such a way that two days (perhaps on weekends) share half of the events and the other five days share the other half. [Specifically, alternative probability vector $p_a = (.25, .1, .1, .1, .1, .1, .25).]$ The distribution is nowhere near
        $mathsf{Chisq}(6).$ Most of the probability is above $12.6.$



        enter image description here



        Note: Here is R code for the first figure:



        set.seed(1124);  m = 10^5;  n = 97;  E = 97/7; q = numeric(m)
        for(i in 1:m) {
        d = sample(1:7, n, rep=T)
        rle.inf = rle(sort(d)); X = rle.inf$len
        q[i] = sum((X-E)^2/E) }
        hist(q, prob=T, br=50, col="skyblue2", ylim=c(0, .14),
        main="Simulated CHISQ(6) with Density")
        curve(dchisq(x, 6), 0, 25, add=T, lwd=2)






        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Nov 24 at 21:53

























        answered Nov 24 at 20:45









        BruceET

        34.9k71440




        34.9k71440






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011944%2fwhat-hypothesis-test-is-suitable-in-this-case%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Tonle Sap (See)

            I get strange results when I access the Sqlitedatabase with Unity C# via XAMPP

            Guatemaltekische Davis-Cup-Mannschaft