May be you are also not familiar with statistic. the solution of min \sum_{i=1}^{n} (y_{i}-b)^{2} is the mean. So the solution is b<-mean(y) Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. ----- Message d'origine ---- De : Kåre Edvardsen <ked@nilu.no> À : R-help <r-help@stat.math.ethz.ch> Envoyé le : Vendredi, 8 Décembre 2006, 13h20mn 10s Objet : [R] A smal fitting problem... Dear R-helpers, I'm for sure not familiar with R, but it seem like a nice sofware tool, so I've decided to try using it. Here is my problem I just can't figure out: I'd like to do least square fit of a straight horizontal (a = 0) line y = ax + b through some data points x = (3,4,5,6,7,8) y = (0.62, 0.99, 0.83, 0.69, 0.76, 0.82) How would i find b????? All the best, Ked [[alternative HTML version deleted]] ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ___________________________________________________________________________ Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internaut [[alternative HTML version deleted]]