Displaying 1 result from an estimated 1 matches for "regtab".
Did you mean:
regrab
2008 Feb 25
1
"by" function "half-working" when used in a custom function
...quot; function such as following :
temp <- by( data, data$categorical.factor , function(x) summary( glm( formula = data$var1 ~ data$var2 , data = x , family = binomial("logit"))))
and it worked perfectly well
Next I tried to create a custom function that contains the latter syntax
regtab <- function(category, arg1, arg2 , data){
temp <-by( data, category , function(x) summary( glm( formula= arg1 ~ arg2 , data=x , family = binomial("logit"))))
temp
}
the resulting object of this function is a list with the correct subgroup categories as its element's name...