Very basic GLM help

Thank you for your replies. I acknowledge that I have only basic understanding of programing syntax and often make mistakes. I will continue to try and learn.

df = DataFrame(A = rand(500), B = repeat(1:10, inner=50), C = 1:500)
linear_model_df = lm(@formula(A ~ C),df)
pred = DataFrame(C = 1:500);
pred.y = predict(linear_model_df, pred)

plot(df.C,df.A)
plot!(pred.C,pred.y)
2 Likes