Hi and thank you in advance for any suggestions here! My question is using nls()
how can I
find the best optimal fit amongst the other fits-- ie linear and non linear-- for my data and
show the fit on the ggplot graph below?
library(ggplot2) library(mosiac) library(tidyverse) library(dplyr) # data frame FX <- data.frame(Location=c(1:5), mi=c(1, 4, 16, 16^2,256^2)) #Visual ggplot(FX,aes(x=Location, y=mi))+ geom_line(alpha=0.9, color="red") # nls(). It shows error of Error in nls(mi ~ Location, data = FX, start = list(mi = 1, #Location = 1)) : #no parameters to fit nls(mi~Location,data=FX,start=list(mi=1,Location=1))