I am trying to plot a regression line which is modelled by p/(1-p) = -41.828+0.9864x, where p is the probability of an event, dependent on x. I only need to plot this using julia, so that the general trend is clear. I have rearranged the model to be p=1/(exp(41.828-0.9864x)+1), however, whenever I plot this using julia, it returns an error. I have attached my code below, and the subsequent error. Have tried all manner of things that I can think of to get around the error, but am unable to... Any help would be appreciated! Apologies for any formatting mistakes I've made, first time using this site, but I tried to do as asked.
using PyPlot , Distributions , StatsBase, DataFrames
xlin = float(linspace(-50.0,50,1000)); y=1.0/float(exp(41.828-0.9864*
(float(xlin)))+1.0)
PyPlot.plot(xlin, y, color="red", linewidth=2.0, linestyle="--")
title("Regression Line Plot");
PyPlot.grid(-25:7:125);
ylabel("Y");
xlabel("X");
This returns the error:
MethodError: no method matching /(::Float64, ::Array{Float64,1})
Closest candidates are:
/(::Float64, ::Float64) at float.jl:246
/(::PyCall.PyObject, ::Any) at
/home/juser/.julia/v0.5/PyCall/src/PyCall.jl:702
/(::Real, ::Complex{T<:Real}) at complex.jl:182
...