Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
294 B
1
Indexable
Never
model2 <- nls(mpg ~ a0 * b1^wt, data = mtcars, start = list(a0 = 1, b1 = 2))
summary(model2)
model2_results<-data.frame(pred=49.65969*0.74559^mtcars$wt,
 real=mtcars$mpg)
model2_results<-model2_results%>%
 mutate(res=real-pred)
model2_R2<-(cor(model2_results$real, model2_results$pred))^2