r - Function for Logistic Regression Training Set -



r - Function for Logistic Regression Training Set -

i trying create function test logistic regression model developed on training set.

for example

train <- filter(y, folds != i) test <- filter(y, folds == i)

i want able utilize formula different info sets. example, if take y response variable such “low” in birthwt info set , x explanatory variables e.g. “age", “race” how implement these arguments glm.train formula without having type function separately different info sets ?

glm.train <- glm(y ~x, family = binomial, info = train)

you can utilize reformulate create formula based on strings:

x <- c("age", "race") y <- "low" form <- reformulate(x, response = y) # low ~ age + race

use formula glm:

glm.train <- glm(form, family = binomial, info = train)

r logistic-regression

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -