I am using the nls2
package to do a fit. The fit is correct but how do I get back just the calculated values of the predicted variables?
The formula:
fit <- nls2(Trans ~ t - (h * W ^ 2 / ((WLn - x0) ^ 2 + W ^ 2)),
data = siteData,
start = list(t=0.6, h=0.5, x0=830, W=100),
algorithm = "port",
#trace = TRUE,
lower = c(t=-Inf, h=0, x0=700, W=35),
upper = c(t=0.6, h=Inf, x0=950, W=Inf)
)
fit
i.e. how can I get back the values for t, h, x0, & W only? Thanks!