nls_fit: Non-linear Least Squares Fit

Description Usage Arguments Details Value Examples

View source: R/nls_fit.R

Description

Fit a dose response curve using the Levenberg-Marquardt Nonlinear Least-Squares squares algorithm from the minpack.lm package. Estimated pIC50 values can be extracted from the fit using the nls_extract function.

Usage

1

Arguments

df

A data frame with column names resp, conc and cell_id.

Details

NOTE: sometimes the fit will fail, in which case null is returned

Value

an object of class 'nls' representing the nonlinear least squares model fit.

Examples

1
2
3
4
5
6
data(drc_data_small)
cl1_data <- dplyr::filter(drc_data_small, cell_id==1)
fit <- nls_fit(cl1_data)
fit
broom::tidy(fit)  #on log-normal scale
nls_extract(fit)  #convenience function converts scales automatically

chapmandu2/pgxsim documentation built on May 6, 2019, 10:13 a.m.