Hello,
I do a regression with R and i want to represent the smooth in a graph, my code is this
ggplot(essence, aes(x=Y, y=GPOP))+
ggtitle("Relation entre le revenu par tête et la conso. par tête")+
xlab("Logarithme du revenu par tête")+
ylab("Logarithme de la conso; par tête")+
geom_point()+
geom_smooth(method="glm", **formula=y~(x^(6.04963))/exp(6.04963)**)
I have this error : Warning message:
Computation failed in stat_smooth():
invalid power in formula
Outside of a model formula the hat symbol ^ does indeed represent the raising x to power y , but in the model formula context it has some other meaning (limit crossing, i dont know) but i know that if you want it treated in the numericalnwaybyou want you wrap its expression within I()