search for: logistictest

Displaying 2 results from an estimated 2 matches for "logistictest".

2009 Oct 11
3
passing field name parameter to function
...eate a vector based in that field. for example if I hard code with the actual field name Y = df$Target, everything works fine. but if I use the passed in parameter name, it doesn't give me what I want, Y = df$mytarget Here is the function, # trying to pass field name to a function logistictest <- function(df,mytarget) { #library for AUC calculation library(caTools) #build logistic model mytarget <- deparse(substitute(mytarget)) myformula <- paste(mytarget," ~ .") myformula <- deparse(substitute(myformula)) logistic_reg <- glm(myformula , data=df, family...
2009 Oct 10
1
field names as function parameters
...g to create a vector based in that field. for example if I hard code with the actual field name Y = df$Target, everything works fine. but if I use the passed in parameter name, it doesn't give me what I want, Y = df$mytarget Here is the function, # trying to pass field name to a function logistictest <- function(df,mytarget) { #library for AUC calculation library(caTools) #build logistic model mytarget <- deparse(substitute(mytarget)) myformula <- paste(mytarget," ~ .") myformula <- deparse(substitute(myformula)) logistic_reg <- glm(myformula , data=df, family=binom...