I am trying to use a logistic model of the form
Y = exp(ao + a1fi1....)/(1 + exp(a0 + a1fi1 ....)
for multiple non linear regression in R, The dependent variable Y is a row consisting of about 500 values and there are 33 independent variables X1, X2, X3.....X33
I am reading my data from an EXCEL file:
data1<-read.csv(file.choose(), header=TRUE)
which populates R with my data. I performed linear regression with the lm() function using input:
results<- lm(Y~ X1 + X2....X33, data = data1)
which worked perfectly fine and now I am trying to use the self starting logistic function of the form:
nls(Y ~ SSlogis(x, Asym, xmid, scal), data1)
for non linear regression; however, I do not seem to be applying the function properly. Thus my question is how would I use this function to perform multiple non linear regression analysis for my dataset?? Thank you for any help you can provide.
You simply choose the type of the model when doing regression. The codes following should help. (I used a online dataset for example)
mydata <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")
model <- glm(admit ~ .,
family=binomial(link='logit'),
data= my data)
Then you can use following code to get more info about your model
fit
fit$resample
fit$results
fit$finalModel
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.