Linear regression where am i going wrong?

Click For Summary
SUMMARY

The discussion centers on a linear regression analysis using the least squares fit method to determine the concentration of cocaine in a sample. The user is attempting to calculate the slope (m) of the regression line but is obtaining an incorrect value of -20787.39 instead of the expected 267.25. Key calculations involve the peak height and the variables X, Y, and their products. The user seeks assistance in identifying the error in their calculations.

PREREQUISITES
  • Understanding of linear regression and least squares fit method
  • Familiarity with statistical calculations involving mean and variance
  • Knowledge of how to interpret regression coefficients
  • Basic proficiency in data analysis tools such as Excel or Python libraries (e.g., NumPy, pandas)
NEXT STEPS
  • Review the calculation of the slope in linear regression using the formula for least squares fit
  • Learn about the significance of residuals in regression analysis
  • Explore data visualization techniques to plot regression lines using tools like Matplotlib
  • Study the impact of outliers on regression results and how to handle them
USEFUL FOR

Data analysts, statisticians, and researchers involved in quantitative analysis, particularly those working with regression models in fields such as chemistry or pharmacology.

Scarpetta
Messages
3
Reaction score
0
linear regression where am i going wrong??

Linear regression using least square fit method for the
determination of cocaine sample
Cocaine (mg/ml) Peak height
X= 2.75 Y=27377 X squared=0.9625 X x Y=3241.272

M = 10 x 3241.272 – 2.75 x 27377 / 10 x 0.9625 – 7.5625

= -42874.03 / 2.0625 = -20787.39 ?

I should be getting m = 267.25 according to graph
Can anyone tell me where I am going wrong please
 
Last edited:
Physics news on Phys.org
Hey! Is helping you on this problem going to get us in trouble with the DEA?

Carl
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
Replies
3
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
5K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K