I need to perform three non-linear regression with the following formulas:
fire_vertical<-nls(R~0.23-exp(A*lnNt+C)+d*fire,start=list(A=-0.33,C=0.45,d=-0.001),trace=T)
fire_lateral<-nls(R~0.23-exp((A*lnNt)+(C+d*fire)),start=list(A=-0.33,C=0.45,d=-0.001),trace=T)
fire_nonlinear<-nls(R~0.23-exp((A+d*fire)*lnNt+C),start=list(A=-0.33,C=0.45,d=-0.001),trace=T)
I have the following data:
R<-c(0.02,0.00,-0.06,0.11,0.06,0.00,-0.05,-0.06,0.02,-0.26,0.00,0.07,-0.07,0.23,0.06,-0.14,-0.04,0.09,-0.09,0.09,-0.02)
lnNt<-c(6.14,6.14,5.76,6.42,6.81,6.81,6.49,6.14,6.24,4.81,4.81,5.14,4.81,6.03,6.42,5.59,5.39,5.90,5.39,5.90,5.76)
fire<-c("before","before","before","before","before","before","before","afterone","afterone","afterone","afterone","afterone","afterone","afterone","aftertwo","aftertwo","aftertwo","aftertwo","aftertwo","aftertwo","aftertwo")
"lnNt" and "fire" are my independent variables. lnNt are continuous data, while "fire" is a categorical variable with three levels:"before", "afterone" and "aftertwo".
I need to transform my categorical variable ("fire") into a dummy variable to run the model. I'm not able to run the model with the dummy variable.