[R] Non-Linear Regression with two Predictors

Berlinerfee berlinerfee at yahoo.de
Sun Jul 26 18:52:21 CEST 2009


Hello there,

I am using nls the first time for a non-linear regression with a 
logistic growth function:
startparam <- c(alpha=3e+07,beta=4000,gamma=2)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 ) 
) ) ),data=dataset,start=startparam)

Everything works fine and i get good results. Now I would like to 
improve the results using my DUMMY Variable (dataset$V6) the runs half 
of the time 0 and then 1. This is my new nls:
startparam <- c(alpha=3e+07,beta=4000,gamma=2,delta=1000000)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 ) 
) ) + (dataset$V6*dataset$V1*delta) ),data=dataset,start=startparam)

I get "Singular Gradient Matrice". May anyone give me the right nls 
function for this problem??

Regards




More information about the R-help mailing list