search for: myglm

Displaying 7 results from an estimated 7 matches for "myglm".

Did you mean: mygl
2009 Jul 26
1
obtain names of variables and data from glm object
Suppose we have some glm object such as: myglm <- glm( y ~ x, data=DAT) Is there an elegant way--or the "right way" within the R way of thinking--to obtain the names of the response variable, the predictor variables, and the dataset, as character strings? For instance, suppose the "right way" was to use the (currently f...
2006 Jun 30
2
Passing arguments to glm()
Hi there I want to pass arguments (i.e. the response variable and the subset argument) in a self-made function to glm. Here is one way I can do this: f.myglm <- function(y,subfact,subval) { glm(d.mydata[,y]~d.mydata[,'x1'],family=binomial,subset=d.mydata[,subfact]==subval) } > str(d.mydata) `data.frame': 15806 obs. of 3 variables: $ y : Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 NA 1 1 ... $ x1: Factor...
2010 Jun 05
1
glm output format
Hello,   I am running a loop to compare some residual deviances obtained from glm, with codes: ........   OUT<-NULL for (i in 1:10){  myglm<-glm(mat ~X1+X2+X3,family = binomial, data =myDATA) OUT<-c(OUT,myglm$deviance) }   .......   In the loop, X1, X2, and X3 chage with i. If X1, X2 and X3 are not highly correlated, OUT is a vector of 10 values.   The problem is:  if there there is one set of X1,X2,X3 that are highly correlate...
2005 Mar 18
2
logistic model cross validation resolved
...with is an integer. If you want to have the predicted values or models returned from each fold, the calls to errorest, can be modified. Please see the help page for control.errorest on details. T -- Trevor Wiens twiens at interbaun.com ========================================================== myglm <- function(formula, family, data){ ret <- glm(formula, family=binomial, data=data) return(ret) } myfacpred <- function(object, newdata) { ret <- as.factor(ifelse(predict.glm(object, newdata, type='response') < 0.5, 0, 1)) return(ret) } # logerrorest takes four arguments #...
2006 Mar 02
1
predict.glm - how to?
Hi I have a little R problem. I have created a GLM model in R and now I want to predict some values outside the values I have in the model (extrapolate). I have this code: fitted.model4 <- glm(Yval ~ time, family=gaussian, data=Fuel) The question is - How do I predict a value of Yval ie with a value of time = 340 and also get confidence/prediction intervals for Yvar? I have tried the
2009 Jan 14
1
loglm fitting
Dear all, sorry to bother you all with this but I've been trying to use the loglm in MASS package (v2.8.0) and cannot get any sensible output. I'm wondering am I doing something very foolish or missing something obvious. For example, I tried the documentation help(loglm) example - here's the code # Case 1: frequencies specified as an array. sapply(minn38,
2009 Jul 02
1
skip the error to continue the logistic regression in a loop
Hi, everyone: I am running logistic regression on a bunch of variables using apply command. But an error occurs, the whole process stops. I am wondering if anyone knows how to skip this error and to continue the regression for the rest of variable. What I did is that first confine a function to the logistic regression, then use apply(data, 2, reg.fun) Then I got an error which is [1]