Régression linéaire avec R
Table des matières
R?gression lin?aire simple
y en fonction de x :
Code R :
x<-c(2,5,3,7) y=2*x+5 lm(y ~ x)
La commande retourne :
Call: lm(formula = y ~ x) Coefficients: (Intercept) x 5 2
On peut ?galement appeler la fonction lm avec une data frame :
Code R :
dframe<-data.frame( x=c(2,5,3,7), y=c(9, 15, 11, 19)) reglin <- lm(y ~ x, dframe)
Pour tracer la droite de r?gression :
Code R :
plot(y ~ x, dframe) abline(lm(y ~ x, dframe))
? Cours pr?c?dent
Test de corr?lation avec R
Cours suivant ?
Test de Chi2 avec R
Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.
Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.
Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!
Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!
Recommended for You!
Get involved :
Click to follow us on Facebook:
Comment this article by clicking on "Discussion" button (top-right position of this page)
Click to follow us on Facebook:
Comment this article by clicking on "Discussion" button (top-right position of this page)