0

Previously I used SAS to fit data into nonlinear regression model. SAS was able to produce an analysis of variance table for the model. The table displays the degrees of freedom, sums of squares, and mean squares along with the model F test.

Please refer to Table 69.4 in this pdf file.

Source: https://support.sas.com/documentation/onlinedoc/stat/132/nlin.pdf

How can I re-create something similar in R? Thanks in advance.

SYL
  • 1
  • 1
  • 2
    I don't think you uploaded the correct image....I embeded the image rather than a link. – Reeza Jan 19 '21 at 20:31
  • 2
    But it's a pretty good challenge to try to figure out what book it's from :-) Looks like ["Rise and Growth of the Anglican Schism"](https://books.google.ca/books?id=_9sadiGTUvAC&pg=RA4-PA373&dq=%22belgium+corrupted+by+heresies%22&hl=en&sa=X&ved=2ahUKEwiricTB7KjuAhXxUN8KHZKWAw4Q6AEwAHoECAAQAg#v=onepage&q=%22belgium%20corrupted%20by%20heresies%22&f=false) – Ben Bolker Jan 19 '21 at 20:35
  • Thanks guys, just realised I am not allowed to embed image yet since I am quite new here. The table example is in the link provided. Any help is much appreciated :) – SYL Jan 20 '21 at 20:15

1 Answers1

0

I'm not sure what type of nonlinear regression you're interested in- but the general approach would be to run the model and call for a summary. The typical linear model would be:

linearmodel = lm(`outcomevar` ~ `predictorvar`, data = dataset)

linearmodel #gives coefficients
summary(linearmod) # gives model fit

For nonlinear regression you would add the polynomial term. For quadratic fit it would be

y = b0 + b1(Var) + b2(Var * Var) or:

nonlinmodel = lm(`outcomevar` ~ `predictorvar` + I(`predictorvar`^2), data = dataset)

nonlinmodel
summary(nonlinmodel)

other methods here: https://data-flair.training/blogs/r-nonlinear-regression/

Jonni
  • 804
  • 5
  • 16