I am trying to create a regression line to a scatterplot but when I try to append the trace with:
n=np.size(x_reg)
mean_x, mean_y=np.mean(x_reg), np.mean(y_reg)
SS_xy= np.sum(y_reg*x_reg - n*mean_y*mean_x)
SS_xx=np.sum(x_reg*x_reg - n*mean_x*mean_x)
b_1=SS_xy/SS_xx
b_0=mean_y-b_1*mean_x
y_pred=b_0+b_1*x_reg
fig.append_trace(trace=go.scatter(
x=x_reg,
y=y_pred,
), row=int(rowlist[math.floor(r_i)]) , col=1)
I get the error
, line 282, in corel_plot
y=y_pred,
TypeError: 'module' object is not callable
The type of both x_reg and y_pred is pandas.core.series.Series of equal length, with values of type numpy.float64.
I tried to make a list of them but that did still give the same error.
Also, since x and y are of same type, and same length it is pretty strange that the error is only thrown for y, and x apparently is executed without an issue.