> > flags <- c(rep(1, length(patient_indices)), rep(0,
> > length(control_indices)))
> > # dataset is a data.frame and param the parameter to be analysed:
> > data1  <- dataset[,param][c(patient_indices, control_indices)]
> > fit1 <- glm(flags ~ data1, family = binomial)
> > new.data    <- seq(0, 300, 10)
> > new.p   <- predict(fit1, data.frame(newdata = new.data), type =
> > "response")
> 
> Should (probably)  have been ... names of RHS variables need to be
> exact match:
> 
> new.p   <- predict(fit1, newdata= data.frame(data1 = new.data), type =
> "response")

Thanks, David and Dennis. That's the thing. I have tried so many alterations 
overlooking that I mangled old and new variable names, unable to see the 
obvious. Well, again a nice demonstration of the perils of copy & paste.

Thanks,
Christian

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to