I’m trying to do a Spearman Correlation Test, because I know from my regression test, that the data is polynomial, not linear. But, when I run the test, it just says corspearman, how do I enter the variables from my dataframe, into the test?
`float` not defined on abstractly-typed arrays; please convert to a more specific type
error(::String) at error.jl:33
float(::Array{Real,1}) at float.jl:894
corkendall(::Array{Real,1}, ::Array{Real,1}) at rankcorr.jl:103
top-level scope at FemLabour.jl:29
What are the types of the dataframe columns? If you type in the name of the DataFrame in the REPL and press enter, the top of each column will be the types.
You can also see the types of the columns by using the describe function, describe(df)
It looks like you’re running into trouble with typing from XLSX again - I would therefore again suggest you put your tabluar data in csv format, which will make life a lot easier.
Apart from that you can try corkendall(Float64.(df.Female_Employment), Float64.(df.Crude_Birth_Rate))
“Getting the csv to work” is as easy as doing “Save as” in Excel and changing the file format to csv. That obviously doesn’t preclude you from keeping an xlsx version around if you want to make charts in Excel, although I’d say here’s a great opportunity to learn how to make Plots in Julia
My apologies, I screwed up my own MWE above: I added using DataFrames at the start clearly because I was going to actually use it in the example…
As the error says, a Matrix is not a Table, so you need to convert it into one - an easy way to do it is to pass it to the DataFrame constructor. Replace the second line with: