I have some data, linked here: https://docs.google.com/spreadsheets/d/1rGgny-SZHzkjwj7xTSuEbLEhvx_JoVraG3udWqk-zN0/edit?usp=sharing
I tried to do a simple lm
. My code is:
testLM <- lm(formula=No~ScoreMA, data=MA.df)
The results I observed are 1.653e-02 for the variable (p-val <2e-16) and 1.479e+01 for the intercept (p-val <2e-16).
This is an impossible result because from the plot, it is quite clear that the gradient should be positive and the data is quite good linearly speaking. I tried to use online tools and it is proved. I attached the picture. What's wrong with my R code? Thank you.