# Entering xlsx columns into HypothosisTests

**URL:** <https://discourse.julialang.org/t/entering-xlsx-columns-into-hypothosistests/35157>\
**Category:** Statistics\
**Tags:** gettingstarted\
**Created:** [February 26, 2020, 8:33am UTC](https://discourse.julialang.org/t/entering-xlsx-columns-into-hypothosistests/35157 "2020-02-26T08:33:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 26, 2020, 9:58am UTC](https://discourse.julialang.org/t/entering-xlsx-columns-into-hypothosistests/35157/2 "2020-02-26T09:58:12Z")

</div>

I’m not sure I understand what you’re trying to do, it would be helpful if you could provide a [MWE](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757). I’ll take a stab anyway:

I’m assuming you’re trying to perform Pearson’s chi-squared test from [HypothesisTests.jl](https://juliastats.org/HypothesisTests.jl/stable/parametric/#Pearson-chi-squared-test-1). As the documentation says, it expects either a vector or a matrix of integers, depending on what you are trying to test.

Below an example of how to do this assuming your data is in a DataFrame. Note that the tests I run below might not make any sense whatsoever, as I don’t understand what your data actually is!

```julia
julia> using DataFrames, HypothesisTests

julia> data = DataFrame(variable = ["Q1","Q2", "Q3"], x1 = [1.47, 1.65, 1993.14], x2 = [1, 1, 1988], x3 = [2,3,9])

julia> ChisqTest(data.x2)
Pearson's Chi-square Test
-------------------------
Population details:
    parameter of interest: Multinomial Probabilities
    value under h_0: [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]
    point estimate: [0.0005025125628140704, 0.0005025125628140704, 0.9989949748743718]
    95% confidence interval: Tuple{Float64,Float64}[(0.0, 0.0016), (0.0, 0.0016), (0.998, 1.0)]

(...)

julia> ChisqTest(Matrix(data[:, [:x2, :x3]]))
Pearson's Chi-square Test
-------------------------
Population details:
    parameter of interest: Multinomial Probabilities
    value under h_0: [0.001486547862359114, 0.001982063816478819, 0.9895453603770503, 1.0458125664837987e-5, 1.3944167553117318e-5, 0.006961625650893821]
    point estimate: [0.000499001996007984, 0.000499001996007984, 0.9920159680638723, 0.000998003992015968, 0.0014970059880239522, 0.004491017964071856]
    95% confidence interval: Tuple{Float64,Float64}[(0.0, 0.0042), (0.0, 0.0042), (0.989, 0.9957), (0.0, 0.0047), (0.0, 0.0052), (0.0015, 0.0082)]

```

---

_[View the full topic](https://discourse.julialang.org/t/entering-xlsx-columns-into-hypothosistests/35157)._
