(a)
\nThe expected frequencies are given by replacing a value in the table by the expected value:
\n\\[E = \\frac{\\textrm{row total} \\times \\textrm{column total}}{\\textrm{overall total}}\\]
\nFor example, the Excellent category for Marketing & Management lies in the second row (with sum $\\var{r2}$) and the first column (with sum $\\var{col1}$).
\nSo the expected frequency of Excellent Marketing & Management students is:
\\[E = \\simplify[]{({r2}*{col1})/({tot})} = \\var{e4}\\]
Hence we get the following table of expected frequencies:
\nEXPECTED FREQUENCIES | \nExcellent | \nStrong | \nAverage | \n
Marketing | \n{e1} | \n{e2} | \n{e3} | \n
Marketing & Management | \n{e4} | \n{e5} | \n{e6} | \n
Business Management | \n{e7} | \n{e8} | \n{e9} | \n
Accounting & Finance | \n{e10} | \n{e11} | \n{e12} | \n
Mathematics | \n{e13} | \n{e14} | \n{e15} | \n
In order to test to see if there is an association we compare this table with the table of observed values and calculate the test statistic by looking at
\n\\[\\chi^2 = \\sum \\frac{(O - E)^2}{E}\\]
\nCalculating the values for Business Management and Mathematics, all to 3 decimal places, you should obtain:
\n$\\frac{(O - E)^2}{E}$ | \nExcellent | \nStrong | \nAverage | \n
Marketing | \n{ch1} | \n{ch2} | \n{ch3} | \n
Marketing & Management | \n{ch4} | \n{ch5} | \n{ch6} | \n
Business Management | \n{ch7} | \n{ch8} | \n{ch9} | \n
Accounting & Finance | \n{ch10} | \n{ch11} | \n{ch12} | \n
Mathematics | \n{ch13} | \n{ch14} | \n{ch15} | \n
To find the $\\chi^2$ statistic you sum these fifteen values to get:
\n\\[\\begin{eqnarray} \\chi^2 &=& \\var{ch1} + \\var{ch2} + \\var{ch3} + \\var{ch4} + \\var{ch5} +\\\\ && \\var{ch6} + \\var{ch7} + \\var{ch8} + \\var{ch9} + \\var{ch10} +\\\\ && \\var{ch11} + \\var{ch12} + \\var{ch13} + \\var{ch14} + \\var{ch15} \\\\ &=& \\var{ch}. \\end{eqnarray}\\]
\n\n\n(b)
\nThe degrees of freedom is given by:
\n\\[\\nu = (\\textrm{no. of rows} - 1) \\times (\\textrm{no. of columns} - 1) = 4 \\times 2 = 8\\]
\nThe following are the critical values for $\\nu = 8$:
\n$p$-value | \n$10 \\%$ | \n$5 \\%$ | \n$1 \\%$ | \n
Critical value | \n$\\var{t90}$ | \n$\\var{t95}$ | \n$\\var{t99}$ | \n
Comparing these values with the the test statistic we see that the $p$-value {pResult}.
\n\n\n\n(c)
\nAs the $p$-value {pResult}, there is {evi} evidence against $H_0$.
\nHence we {retain}.
\n{summary}
", "preamble": {"css": "", "js": ""}, "tags": [], "parts": [{"customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "information", "showFeedbackIcon": true, "variableReplacements": [], "showCorrectAnswer": true, "prompt": "$H_0$: There is no association between degree subject and performance.
\n$H_1$: There is an association between degree subject and performance.
", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "gapfill", "showFeedbackIcon": true, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": false, "minValue": "e7", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e7", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": false, "minValue": "e8", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e8", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": false, "minValue": "e9", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e9", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": false, "minValue": "e13", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e13", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": false, "minValue": "e14", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e14", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": true, "useCustomName": false, "showPrecisionHint": false, "minValue": "e15", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "e15", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "unitTests": [], "strictPrecision": false, "useCustomName": false, "showPrecisionHint": true, "minValue": "ch-0.005", "showFeedbackIcon": true, "precision": "3", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "mustBeReduced": false, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "precisionType": "dp", "variableReplacements": [], "type": "numberentry", "maxValue": "ch+0.005", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}], "prompt": "You are given the expected frequencies (all to $3$ decimal places) for Marketing, Marketing & Management and Accounting & Finance.
\nYou have to calculate the expected frequencies for Business Management and Mathematics and put them in the following table.
\nInput each expected frequency to $3$ decimal places.
\nEXPECTED FREQUENCIES | \nExcellent | \nStrong | \nAverage | \n
Marketing | \n{e1} | \n{e2} | \n{e3} | \n
Marketing & Management | \n{e4} | \n{e5} | \n{e6} | \n
Business Management | \n[[0]] | \n[[1]] | \n[[2]] | \n
Accounting & Finance | \n{e10} | \n{e11} | \n{e12} | \n
Mathematics | \n[[3]] | \n[[4]] | \n[[5]] | \n
In order to test to see if there is an association we compare this table with the table of observed values and calculate the test statistic by finding:
\n\\[\\chi^2 = \\sum \\frac{(O - E)^2}{E}\\]
\nNow calculate the test statistic $\\chi^2 = \\phantom{{}}$[[6]]
\n", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "gapfill", "showFeedbackIcon": true, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"allowFractions": false, "correctAnswerFraction": false, "customMarkingAlgorithm": "", "marks": 1, "unitTests": [], "showFractionHint": true, "minValue": "8", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "numberentry", "showFeedbackIcon": true, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "maxValue": "8", "scripts": {}, "mustBeReduced": false, "correctAnswerStyle": "plain", "customName": "", "extendBaseMarkingAlgorithm": true}, {"minMarks": 0, "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "maxMarks": 0, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["$p$ is bigger than $10 \\%$
", "$p$ lies between $10 \\%$ and $5 \\%$
", "$p$ lies between $5 \\%$ and $1 \\%$
", "$p$ is less than $1 \\%$
"], "variableReplacements": [], "showCorrectAnswer": true, "displayType": "radiogroup", "matrix": "Mm", "shuffleChoices": false, "displayColumns": 1, "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}], "prompt": "Calculate $\\nu$, the degrees of freedom, for this test.
\n$\\nu = \\phantom{{}}$[[0]]
\nUse tables to find a range for your $p$-value. Choose from the options below.
\n[[1]]
", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "gapfill", "showFeedbackIcon": true, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"minMarks": 0, "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "maxMarks": 0, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["None
", "Slight
", "Moderate
", "Strong
"], "variableReplacements": [], "showCorrectAnswer": true, "displayType": "radiogroup", "matrix": "Mm", "shuffleChoices": false, "displayColumns": 0, "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"minMarks": 0, "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "distractors": ["", ""], "maxMarks": 0, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["Retain $H_0$
", "Reject $H_0$
"], "variableReplacements": [], "showCorrectAnswer": true, "displayType": "radiogroup", "matrix": ["if(pval<2,1,0)", "if(pval>=2,1,0)"], "shuffleChoices": false, "displayColumns": 0, "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}, {"minMarks": 0, "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "distractors": ["", ""], "maxMarks": 0, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "1_n_2", "showFeedbackIcon": true, "choices": ["There is evidence to suggest an association between degree subject and performance.
", "There is insufficient evidence to suggest an association between degree subject and performance.
"], "variableReplacements": [], "showCorrectAnswer": true, "displayType": "radiogroup", "matrix": ["if(pval>=2,1,0)", "if(pval<2,1,0)"], "shuffleChoices": false, "displayColumns": 1, "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}], "prompt": "Given the $p$-value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour decision:
\n[[1]]
\nYour conclusion:
\n[[2]]
", "scripts": {}, "customName": "", "extendBaseMarkingAlgorithm": true}], "ungrouped_variables": ["f1", "ch", "presult", "a", "d", "r2", "pval", "b1", "b2", "t95", "t1", "c1", "d1", "e11", "e10", "e13", "e12", "e15", "e14", "tot", "ch15", "e3", "b", "t", "r4", "ch13", "col2", "col3", "col1", "a1", "a2", "e9", "t99", "ch9", "e5", "e4", "e7", "e6", "e1", "c2", "e2", "ch12", "evi", "c", "ch11", "r1", "ch14", "f", "mm", "ch10", "r3", "summary", "t90", "ch1", "ch2", "ch3", "ch4", "ch5", "ch6", "ch7", "ch8", "retain", "r5", "e8"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "The human resources department of a large finance company is attempting to determine if an employee’s performance is influenced by their undergraduate degree subject. Personnel ratings are used to judge performance and the task is to use expected frequencies and the chi-squared statistic to test the null hypothesis that there is no association.
"}, "rulesets": {}, "statement": "\nThe human resources department of a large finance company is attempting to determine if an employee’s performance is influenced by their undergraduate degree subject.
\nThe 5 subjects considered are: Marketing, Marketing & Management, Business Management, Accounting & Finance and Mathematics.
\nPersonnel ratings are grouped as Excellent, Strong and Average.
\nA recent assessment gave the following results:
\n\n | Excellent | \nStrong | \nAverage | \nTotals | \n
Marketing | \n{a} | \n{b} | \n{c} | \n{r1} | \n
Marketing & Management | \n{d} | \n{f} | \n{t} | \n{r2} | \n
Business Management | \n{a1} | \n{b1} | \n{c1} | \n{r3} | \n
Accounting & Finance | \n{d1} | \n{f1} | \n{t1} | \n{r4} | \n
Mathematics | \n{a2} | \n{b2} | \n{c2} | \n{r5} | \n
Totals | \n{col1} | \n{col2} | \n{col3} | \n{tot} | \n
Test the null hypothesis that there is no association between degree subject and performance.
\n", "variable_groups": [], "functions": {}, "extensions": ["stats"], "name": "Simon's copy of Perform chi-squared test on 2D frequency table", "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}