Chi Square Test on Certain Columns in Excel Import?

For a a reprex (see the FAQ the goal is to provide something that can be cut and pasted, which screenshots don't provide.

Assuming the imported object is named my_data run

dput(my_data)

and cut-and paste the results into the question Or you could synthesize data

set.seed(42)
var1 <- sample(1:4,10,replace = TRUE)
var2 <- sample(1:2,10,replace = TRUE)
var3 <- sample(1:2,10,replace = TRUE)
(m <- matrix(c(var1,var2,var3), nrow = 10, ncol = 3))
#>       [,1] [,2] [,3]
#>  [1,]    1    1    1
#>  [2,]    1    2    1
#>  [3,]    1    1    1
#>  [4,]    1    2    1
#>  [5,]    2    1    1
#>  [6,]    4    1    2
#>  [7,]    2    2    1
#>  [8,]    2    2    1
#>  [9,]    1    2    1
#> [10,]    4    2    1

Created on 2023-04-16 with reprex v2.0.2

That's enough to show how it can be one with two different pairs of variables in the same matrix.

Question: assuming a longer matrix m, say 11 numeric variables, are you looking to test just the first five pairs or all 55 possible pairs?

1 Like