3. (i) Below is the R code for performing a X2 test on a 2×3 matrix of categorical variables called TestMatrix: chisq.test(Test Matrix) (a) Assuming we have a significant result for this procedure, provide the R code (including any required packages) for an appropriate post hoc test. (b) If we were to apply this technique to a 2 × 2 case, how would we adapt the code in order to perform the correct test? (ii) What procedure can we use if we want to test for association when we have ordinal variables? What code do we use in R to do this? What package does this command belong to? (iii) The following code contains the initial steps for a scenario where we are looking to investigate the relationship between age and whether someone owns a car by using frequencies. There are two issues with the code - please state these. Row3<-c(75,15) Row4<-c(50,-10) MortgageMatrix<-matrix(c(Row1, Row4), byrow=T, nrow=2, MortgageMatrix dimnames=list(c("Yes", "No"), c("40 or older","<40"))) barplot(MortgageMatrix, beside=TRUE, ylim c(0, 40), legend-T, col=c("yellow", "blue"), xlab="Earnings", ylab="Frequency") [4 Marks]

College Algebra (MindTap Course List)
12th Edition
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:R. David Gustafson, Jeff Hughes
Chapter6: Linear Systems
Section6.2: Guassian Elimination And Matrix Methods
Problem 84E: Explain the differences between Gaussian elimination and Gauss-Jordan elimination.
icon
Related questions
Question
3. (i) Below is the R code for performing a X2 test on a 2×3 matrix of categorical
variables called TestMatrix:
chisq.test(Test Matrix)
(a) Assuming we have a significant result for this procedure, provide the R
code (including any required packages) for an appropriate post hoc test.
(b) If we were to apply this technique to a 2 × 2 case, how would we adapt
the code in order to perform the correct test?
(ii) What procedure can we use if we want to test for association when we
have ordinal variables? What code do we use in R to do this? What package
does this command belong to?
(iii) The following code contains the initial steps for a scenario where we are
looking to investigate the relationship between age and whether someone owns
a car by using frequencies. There are two issues with the code - please state
these.
Row3<-c(75,15)
Row4<-c(50,-10)
MortgageMatrix<-matrix(c(Row1, Row4), byrow=T, nrow=2,
MortgageMatrix
dimnames=list(c("Yes", "No"), c("40 or older","<40")))
barplot(MortgageMatrix,
beside=TRUE,
ylim c(0, 40), legend-T, col=c("yellow", "blue"),
xlab="Earnings",
ylab="Frequency")
[4 Marks]
Transcribed Image Text:3. (i) Below is the R code for performing a X2 test on a 2×3 matrix of categorical variables called TestMatrix: chisq.test(Test Matrix) (a) Assuming we have a significant result for this procedure, provide the R code (including any required packages) for an appropriate post hoc test. (b) If we were to apply this technique to a 2 × 2 case, how would we adapt the code in order to perform the correct test? (ii) What procedure can we use if we want to test for association when we have ordinal variables? What code do we use in R to do this? What package does this command belong to? (iii) The following code contains the initial steps for a scenario where we are looking to investigate the relationship between age and whether someone owns a car by using frequencies. There are two issues with the code - please state these. Row3<-c(75,15) Row4<-c(50,-10) MortgageMatrix<-matrix(c(Row1, Row4), byrow=T, nrow=2, MortgageMatrix dimnames=list(c("Yes", "No"), c("40 or older","<40"))) barplot(MortgageMatrix, beside=TRUE, ylim c(0, 40), legend-T, col=c("yellow", "blue"), xlab="Earnings", ylab="Frequency") [4 Marks]
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
College Algebra (MindTap Course List)
College Algebra (MindTap Course List)
Algebra
ISBN:
9781305652231
Author:
R. David Gustafson, Jeff Hughes
Publisher:
Cengage Learning