Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In nlsplot(), how to see the model equation in R?

I generated one data

nitrogen<- c(0,40,80,120,160,260)
yield <- c(8.4,9.8,10.8,12.5,11.1,12.7)
dataA<- data.frame(nitrogen, yield)

and I’d like to see this data as quadratic-plateau model. So I used nlsplot() code.

install.packages("easynls")
library(easynls)
nlsplot(dataA, model=4)

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The model equation is covered in the graph. I’d like to see the full model equation about this quadratic-plateau model.

Could you let me know how to do it?

Always many thanks!!

>Solution :

One solution could be using par() function to adjust the plot size and font size arguments within par() and then run nlsplot():

# change the font size for the plot
par(cex.lab = 1.5, cex.axis = 1.5, cex=1.2)

# plot the data with formula
nlsplot(dataA, model = 4)

enter image description here
Now I change the font size of the formula to 0.8 to cover better.You can play with the par() arguments to adjust your plot.

par(cex.lab = 1, cex.axis = 1, cex=0.8)

nlsplot(dataA, model = 4)

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading