doPsyFit: Applies a nonlinear regression on a specific dataset.

Description Usage Arguments Value Examples

View source: R/nlregVL.R

Description

Applies a nonlinear regression on a specific dataset.

Usage

1
doPsyFit(xx, pp, type = "CG", getPred, residFun, fnJacob, fnStart, control)

Arguments

xx

quantity on the x axis (e.g. duration). Must be a vector of numerics

pp

quantity on the y axis (e.g. proportion of long responses). Must be a vector of numerics AND of the same length as xx.

type

string expliciting which of three available fitting functions will be used. "CG" for cumulative Gaussian, "LN" for lognormal and "PL" for pseudologistic.

getPred

Function that returns the predicted value.

residFun

Function that returns the residuals.

fnJacob

Function that returns the jacobian of the function to be fitted.

fnStart

Function that returns the starting parameters.

control

a control list for the non linear regression. See nls.lm.control

Value

a psyFitted-class object containing the fitted data.

Examples

1
2
3
4
5
6
7
data("exampleData",package="nlregVL.R")
setkey(exampleData,Sub)
xx<-exampleData[J("TP01")][,Duration]
nbb1<-exampleData[J("TP01"),Nb1]
nbb3<-exampleData[J("TP01"),Nb3]
pp<-nbb3/(nbb1+nbb3)
result<-nlregVL::doPsyFit(xx = xx,pp = pp)

VinLaflamme/nlregVL documentation built on May 30, 2019, 2:04 a.m.