0

I have this code:

df_logannuali <- data.frame("x" =log_annuali2[,1],"y"=log_annuali2[,2])
p <-ggplot(df_logannuali, aes(x, y))
p <- p + geom_point(alpha=2/10,shape=21,fill="blue",colour="black",size=3)+stat_smooth(method="lm", se=TRUE,formula=y ~ poly(x, 5, raw=TRUE),colour="red") 
p+labs(x="Tempo (anni)",y="Sbarcato (log.t.)",title="(17) Sbarcato annuale TS")+ theme_bw() + theme(panel.border = element_blank(), panel.grid.major = element_blank(), 
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"))

the result is :

enter image description here

so now, how i can to obtain the value of polynomial equation like this example:

y = 560x^2+358x^3....-589x^5 

and if is possible plot them on the graph? Thank you

tonytonov
  • 25,060
  • 16
  • 82
  • 98
Diego
  • 633
  • 1
  • 9
  • 16
  • 2
    duplicate of http://stackoverflow.com/questions/11949331/adding-a-3rd-order-polynomial-and-its-equation-to-a-ggplot-in-r – mlegge Dec 02 '15 at 17:15
  • yes,thank you, but i would like to have a summary of value of my equation, in the console non also in the graph, and i don't know the exactly command. – Diego Dec 03 '15 at 11:26

0 Answers0